Looking for code example to speed up load of large tables

Looking for code example to speed up load of large tables

sbaranysbarany Posts: 2Questions: 1Answers: 0

We have a dynamic wp site with rich data incl pictures. Loading of a page with such a table looks strange, the visitor sees at the beginning long seconds while the table builds up row by row - including flicking various sized pictures on the screen -, than that table gets rendered with thumbnails in the rows and in the third phase the table flicks again and gets sorted.
Please help me to find the proper parts of the documentation (and maybe some coding examples) for:
a) how can I generate midnights a static wp page with the current daily content of the given table
b) how can I use that static table data in a new search page?
Many thanks in advance!

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954
    edited June 2020 Answer ✓

    I'm not familiar with WP but this FAQ provides information of how to speed up Datatables.

    the visitor sees at the beginning long seconds while the table builds up row by row - including flicking various sized pictures on the screen

    Sounds like this process is before Datatables.

    than that table gets rendered with thumbnails in the rows

    Is this before or after Datatables is initialized

    the third phase the table flicks again and gets sorted.

    This is definitely Datatables.

    If Datatables is only involved in the third phase then you can hide all this by placing the table in a hidden div then show the div when the Datatable initialization is complete. For example:
    http://live.datatables.net/pinaqopu/1/edit

    It uses columns.adjust() after the Datatable is shown to finalize the columns widths.

    Kevin

  • sbaranysbarany Posts: 2Questions: 1Answers: 0

    Thank you, Kevin! your example snippet works well in a small model. On my WP page I have built a static html table within the hidden div, and appended a call to your .js which I had to store as a file within the js folder in the WP Theme directory. Great!

    Maybe someone in this forum has an answer to my first question as well?

This discussion has been closed.