This is the discussion I had yesterday:
Colleague: Check out this new application I’m building for the web.
Me: Wow - that’s cool! Well, except you shouldn’t be using tables of course.
Colleague: Why not?
Me: Well tables are bad. You know…
Colleague: Nah, tables are fine. Why shouldn’t I use them?
Me: Well, because you should be using HTML and CSS.
Colleague: Why?
Me: Well, there’s lots of reasons…
Colleague: Well give me one…
And that’s where I sort of froze.
Now, imagine this. Someone studies History for 4 years and graduates from college with a degree. First day out and someone says, “History isn’t important.” And the student replies, “Yes it is…” To which the other person says, “Why?” At this point, the student’s brain freezes as there mind goes through the hundreds of possible answers to this question. There are endless numbers of reasons why History is important. But the student’s brain gets so frustrated, that it gives up and just says, “Because it is!!”
Now that’s now a very good argument and that’s what happened to me yesterday. I’ve been studying HTML, CSS and Web Standards for about 2 years now. And I’ve become so engrossed in that world, that when someone asked me a simple question, my brain just froze.
It’s now another day and I’ve had a chance to calm down : ) and think of a sensible reply. For this post, I could go out to Google and just list the numerous reasons why current web sites should not use tables. But, it’s probably better if I just stick to one “real world” reason for today and we can keep this as an ongoing discussion.
So to start, here’s reason #1:
Separating Layout from Design is More Efficient
As any technical developer knows, the client is always changing their mind. Most of time, they don’t know what they actually want until halfway through the project. And then that’s when they really start moving things about!
Now if you write your web page using valid XHTML, the CSS (or design) is totally separate. At this point, if the client wants to change the colour of all their Heading 1’s, it’s a single change to the style sheet. And if they want to change the width of all their pages, it’s a single change to the style sheet.
Width: 500px;
Width: 600px;
A single line change instead of moving about table cells, rows, etc. (Now I know you can apply styling to tables as well, but it’s nowhere near as flexible. You get the point.)
To see a classic example of this, you can visit the CSS Zen Garden. Just click on a style in the left menu and the entire design changes. While all of the HTML remains the same!
http://www.csszengarden.com/
So that’s it for now. Like I said, there are lots of other reasons, but I think that’s a good start.
And a final message to my colleague - “We can continue this conversation in the pub : ) ”
Dennis