Whats the difference in using a div based product list on my ecommerce site or tables. Is the div option better performance wise? Im trying to optimize my site and I am using tables at the moment to display my produc开发者_JAVA百科ts.
Thanks
The choice shouldn't be between divs and tables. It is between semantic markup with CSS for presentation or presentational markup / markup with wrong semantics but desired presentational side effects.
Thinking about it in terms of divs or tables tends to lead down a road of divitus, and markup that is almost as bad as abusing tables for layout.
See why not use tables for layout in HTML?
If you just have a list of item names, use div
s as it will improve performance. If you have tabular data - data with many columns - table
s are the way to go.
For a similar question, see here: Actual table Vs. Div table
It really depends. IMHO If you just want to display a grid of data, a table is likely the way to go. That being said, a div-based layout is easier to style and add/remove rows.
精彩评论