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 indiÂcation 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.