Why HTML Tables Are Still Haunting Us
Thursday, 5th November 2009
It's fairly well accepted in the web developer community that you shouldn't use a table for the purposes of layout. A table is designed to hold logically tabular information and when used for that purpose is excellent. When you use a table to "get your text on the left and your images on the right" - that's bad. Despite the big discussion on tables, though, there are a three reasons why this issue still haunts us.
Reason 1: People don't understand the argument
The first problem is that some designers have interpreted "don't use tables for layout" as "don't use tables". There's quite a difference between those two statements. If you want to show tabular information - use a table (don't use a bunch of divisions cleverly floated and positioned!) In fact, a general case of div-istus seems to be creeping in and making HTML as bulky and nasty looking as table-layouts once did.
If you need to use a table, use one. Just don't use them for laying out your design.
Reason 2: Other elements are the new table
Something I've seen creeping in recently is the similar abuse of other elements in exactly the same way as tables were abused. One example I have seen is where an unordered list was used to indent a button. Many HTML elements have a semantic meaning (just like a table does) and using them in order to get a certain "look" is an abuse.
Don't use lists, headings, block quotes or any other meaningful HTML tag for any other reason than their intended purpose!
Reason 3: Corporations
For some reason, when a perfectly good web designer gains employment for a big company, they start going blind to things that they know are wrong. People who know full well that you shouldn't use a table for a layout suddenly don't mind. I don't know why this is - but it seems strange that the largest companies are happy to have the worst HTML.
The same people use great markup when they design the website for the local skittles club, but for a big financial company, any rubbish will do.
Let's all start using really good markup. If we make great HTML the norm, it will increase the gap between a professional web guy and someone who's found an old copy of "Front Page". It will also make life easier for all those people out there that rely on semantic tags to read a page, whether they are an impaired user - or a search engine robot!