CSS Versus Tables: The War Continues
A year ago this wouldn’t have even been an issue to me. In fact, a year ago, I’d probably have started with a table. Of course, like everyone who intends to stay in this business without becoming a dinosaur of a maintenance programmer, something I just can’t afford to do at my age, I’ve moved up with the times. And, it seems, I’ve moved out, too. Smaller HTML, but bigger attached stylesheets; longer development times, but (usually) more pleasing form-factors, and, let’s face it, some of the things you can do with CSS are just downright fun.
Unfortunately, there’s a very ugly side to this debate. If you’ve actively been on either side of it, then you might hold the opinion that there is no pretty side to the debate, but in a relative sense, there is. The pretty side is about vertical alignment issues, low resolution displays, and the trauma of floats gone wrong. The ugly side is, without question, the unholiest member of the family that is CSS-supporting (however loosely the term need be applied) browsers: IE 6.
When I got back a QA document showing how my beautiful layout had become a mangled mess in IE 6, I was stunned. I’m used to typical IE 6 problems, such as PNG transparency, weird box model rendering, the occasional extra broken line, or borders rendering in the wrong place. What I was simply not prepared for, though, was the carnage that sat before me. Entire paragraphs were somehow invisible until highlighted, even though they were a contrasting color. Form elements drooped off of the carefully sculpted round box. Text was interrupted in the name of a submit button. And to top it all off, the PNGs weren’t even transparent.
I immediately did what any sane developer would do: I called over the guy who gave me the specs and said, “Who cares if it doesn’t work in IE 6?”
“The client does,”
came the reply; “They still have 20% of the browser market share.”
20% is a pretty big number, considering we support chrome at 1/10th of that usage. Even if the data from w3schools is accurate, even if IE 6 is down to a paltry 14.9%, they’re still not falling out of the realm of active use. When you look at the numbers, it’s not really much of a mystery why: According to Appendix Table A (xls) from the U.S. Census Bureau report Computer and Internet Use in the United States: October 2007, in-home saturation of computers with internet access is only about 11% more now than there were in 2001, when IE 6 was released. With the amount of people still using ancient beige-box monstrosities, it’s little wonder how that browser continues to tread water 8 years later. Unfortunately, it’s not the IE 6 users who pay the price for their lack of knowledge.
And this leaves us again in the same old place: The War. All of the arguments over whether tables are bad design or CSS is too complicated are practically rendered moot when you consider that at least 1-in-7 people are using an antiquated piece of technology that will choke, cough, sputter, and finally leave users entirely displeased and demotivated. And since there’s no real stopping it, short of using extreme guerilla tactics, let me give my final opinion on the matter: Just use whichever one works. Tables and Divs can be equally messy, so it’s more important that you just keep your code clean, rather than trying to favor or scorn a particular tag. And, if you’re one of those designers who has become so entrenched in the anti-table battlefield that you refused to use tables to display tabular data, I have 5 words for you: Give Up And Use Tables.
Recent Entries
- Apache Taught You The Wrong Way To Think About Web Applications
- Adventures in Parsing: PHP’s implicit semicolon (‘;’) before every close tag
- The importance of ZVals and Circular References
- PHP Quirks – String manipulation by offset
- Let’s talk about your password model
- Pour Some Syntactic Sugar On Me: ‘Unless’ Keyword
- Arrays of Objects and __get: Friends Forever
- Did You Know? Class Visibility in PHP
- On Net Neutrality – A Plea
- Blankets – Nature’s Simple Truths
July 23rd, 2009 at 22:48
Good article. I, of course, am a tad bit new school as I didn’t start doing any serious web development until late high school and even then I was heavier into the design aspect than I was into the code aspect so I leaned on Dreamweaver’s WYSIWYG functionality with layout tables, click and apply CSS and all sorts of hacks readily available within the software package. Lately I’ve begun to relearn my basic HTML and I’ve picked up CSS as a method of doing layouts and I must say that I actually enjoy it, but I have the luxury of being able to shoo away anybody who is still using IE6. At this point I’m simply worried about filling out a very thin portfolio though so it’s simply a club website and a personal site that I am starting to sink time into. Who knows, someday I may be in a position where IE6 compatibility is a must in a project that I am working on and I may inevitably have to use tables rather than my beloved CSS.
BTW, this is Ed.
July 24th, 2009 at 03:37
As long as you can continue to avoid painting yourself into a corner either way, go for it. I’ve seen examples on both extremes of when tables have been pushed too far and when Divs have been hacked together where tables belong. The key is balance and moderation, a careful considered approach, and a large glass (which some, I have found, also refer to as a “bottle”) of bourbon to deal with the fallout from “enlightened” designers who know the one true way to have made the layout: the way you didn’t.
July 24th, 2009 at 13:39
TL;DR.
July 25th, 2009 at 15:51
Had to delete a pingback from my own blog, but it makes some sense. If you enjoyed this article, you should check out my article on chrome entitled Why Isn’t Google Chrome In Widespread Use Yet?