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.
tableelement in HTML is a semantic structure: it describes what data is. Therefore, you should only use the
tableelement 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.
tablevalue of the
displayproperty, on the other hand, is simply an indication of how something should look in the browser—it has no semantic meaning. Using a
tableelement for your layout tells a user-agent, “This data is tabular.” Using a bunch of
div@s that have the @displayproperty set to
table-cellsays nothing to that user-agent other than asking it to render them visually in a certain way, if it’s capable of doing so.