Question: Is there any way to load DataTables before showing original table?

Question

Is there any way to load DataTables before showing original table?

Answers 1
Added at 2016-12-27 19:12
Tags
Question

I am experiencing difficulties with DataTables. You see, I am loading JavaScript at the end of the </body> tag. So, when I load a page, it shows me original table without search and pagination for 1 second and then loads DataTables. So here is a question: is there anyway to load DataTables before page loads, so it will show DataTable immediately?

Answers
nr: #1 dodano: 2016-12-27 20:12

There are some ways to prevent this FOUC, but you can not init the datatable before actually loading the page.

One option is to hide your table at the start using some CSS like display: none; or visibility: hidden; depending on your layout etc.

Another option would be to pass your data directly to datatables without an intermediate HTML table. You can find the respective example in their documentation.

Source Show
◀ Wstecz