Correct use of table tags
I seem to find myself saying this all too often this year, to both new staff and other friends in the wider community so I thought it best to post briefly. I know a lot of others have covered this topic in the past and continue to do so, but it doesn’t always seem to get through to people.
Do not use <table> for layouts
<table> and its related tags are provided in HTML 4.01 to provide a means for which to define tabular data. Their purpose is neither one or layout or display and should not be used to achieve any visualisation of any type. They exist solely to provide a definition for tabular data.
Well yeah..
It was a popular message, here comes CSS and it answers a bunch of questions about how we style content. But somewhere along the way the message seemed to be misinterpreted or lost in some way… and turned into
“don’t use tables, they are evil” – which it seems a large proportion of entry level web developers still believe to be true. So now we find hordes of people looking at css layout techniques for floating cells to replicate the same functionality a table provides…
Stop it.. oh my god
The original message was “Do not use <table> for layouts” and that is still true, don’t set them at 100% width and start putting your menu and content areas inside tables, it is bad form. But this doesn’t mean stop using tables. If you are displaying tabular data then use a table, its why they exist. Tables are not evil, just the way people chose to use them a few years ago was.
Oh, and you can make them sexy using CSS.


