3 ms·
As someone who certainly is no web developer I made the error of using tables once. Little did I know about the rules how tables have to be rendered. Try to dis
by raxxorraxor 4y ago
As someone who certainly is no web developer I made the error of using tables once. Little did I know about the rules how tables have to be rendered. Try to display something with say 100,000 html table cells. That will inhibit all but the most powerful of machines.
I don't know what causes this exactly. I think it is something about table size calculations being done for every cell you add to the table.
I did want to display a lot of data and with divs the rendering of the page was more or less instant.
- eimrine 4y agoSo your point is that 100000 td elements are slower than 100000 divs with all CSS and data mostly the same? I am also not a professional webdev but that is unbelievable. My expectation is that nothing can beat tables if rendering some table data is needed. All that table/tr/td stuff must be hardware accelerated in some way because a <tr></tr> means a table row and nothing else while <div></div> may be anything. I haven't done any researches but I hope making table using table/tr/td is like to do running using running shoes, while making table using div is like running using regular shoes - or table syntax should be deprecated ASAP.
- raxxorraxor 4y agoI think there are some (historic?) rules for tables in how their width is calculated which doesn't happen with divs. Not really sure though, I am no expert as well.
- mattmanser 4y agoA simple fix for that would have been to switch to table-layout:fixed. So that was your actual mistake, not knowing how to turn off the dynamic layout.
- raxxorraxor 4y agoI am sure I did that. I also specified the width of any cell I knew the length of the content, which was most cells but not all of them. I also had to render the table before all data was loaded. It is probably possible to get them to render quickly, but divs just were more flexible and performed much better. I probably missed something but I could not really figure out what was causing to performance problem.