Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What HTML structure performs better for the browser?

Well, it seems to be the general opinion: We should use tables only for tabular data, and not for layouting.

Ok, I'm agree and I understand the reasons (one of the reasons is the performance).

  • But someone could give real benchmarks comparing tables vs other structures?
  • And what is the best structure for the browser performance?
like image 305
Daniel Peñalba Avatar asked Feb 15 '26 13:02

Daniel Peñalba


1 Answers

You don't need to really do benchmarks.. you can see the difference visually. If you look at a site pre-css-layout, it usually rendered slowly since the table has to be fully drawn out. When it's divided up with css, it's noticeably faster. I've witnessed this on dozens of sites before they converted to css layouts.

In addition, tables require table cells and rows for nearly everything. By not relying on rows/cells, you reduce the code bloat by LOTS.

"Best structure" ? There is no best structure. It all depends on the layout. Though usually, you want to avoid divitus and keep things as succinct as possible yet semantically marked up.

like image 193
meder omuraliev Avatar answered Feb 18 '26 05:02

meder omuraliev