Everything you know about CSS is wrong
22nd Oct 2008
Rachel Andrew explains about CSS tables and why HTML tables for layout will be a thing of the past when IE8 is finally released.
The
table
element in HTML is a semantic structure: it describes what data is. Therefore, you should only use thetable
element if the data you are marking up is tabular—for example, a table of financial information. If it would normally be stored in a spreadsheet on your computer, it probably needs marking up as a table in HTML.The
table
value of thedisplay
property, on the other hand, is simply an indiÂcation of how something should look in the browser—it has no semantic meaning. Using atable
element for your layout tells a user-agent, “This data is tabular.†Using a bunch ofdiv@s that have the @display
property set totable
andtable-cell
says nothing to that user-agent other than asking it to render them visually in a certain way, if it’s capable of doing so.Rachel Andrew