开发者

Div based product list or table based?

开发者 https://www.devze.com 2023-02-02 07:16 出处:网络
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 d

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 divs as it will improve performance. If you have tabular data - data with many columns - tables 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消