Answer the question
In order to leave comments, you need to log in
What is the best way to display a list on a page?
It is necessary to display the list on the page with its subsequent processing.
Often the list has more than 1000 lines and on weak machines, the page starts to slow down.
At the same time, sorting is used in the list, there are buttons and inputs.
Now it all works through ul and li
So, I wondered which output would be less demanding on resources?
Rewrite everything simply into blocks, or maybe the good old table will be processed and displayed much faster?
Answer the question
In order to leave comments, you need to log in
The fastest way to display and sort lists, if all elements are already loaded into the DOM, turned out to be table.
This format was processed the longest. The
average speed turned out to be
AND the fastest.
These results are with 2000+ lines and 7 (span or td) in each. On a smaller number of DIV and table almost do not differ in speed.
If, however, the simultaneous display of the entire list is not critical, then https://www.datatables.net/ is quite suitable.
It keeps the entire table in memory, does not display it in the DOM, and forms it only after the request.
The tool is very useful, and most likely I will switch to it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question