Everything you know about CSS is wrong

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 the table 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 the display property, on the other hand, is simply an indi­cation of how something should look in the browser—it has no semantic meaning. Using a table element for your layout tells a user-agent, “This data is tabular.” Using a bunch of div@s that have the @display property set to table and table-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