Tables Bad, CSS Good

May 10
17:54

2006

John Harris

John Harris

  • Share this article on Facebook
  • Share this article on Twitter
  • Share this article on Linkedin

In the good old days you had no option but to use tables if you wanted to give an impressive presentation on your website. Along came CSS a designer's best friend. There is no web layout that you can create with a table that can not be duplicated with CSS.

mediaimage

Why do we (web developers) use tables??? Yes they make for fantastic designs and organized websites but they are not for this purpose. A table should be used for TABULAR DATA not design and layout. That being said,Tables Bad, CSS Good Articles I have sworn off tables and replaced them with the almighty div tag and CSS.

In the good old days you had no option but to use tables if you wanted to give an impressive presentation on your website. Along came CSS a designer's best friend. There is no web layout that you can create with a table that can not be duplicated with CSS.

"But using CSS to design my website is too complicated" I have heard this to many times in the span of my career. You can learn how to properly use CSS in less time than it took you to figure out how to nest a table inside of table, inside of table... In future articles I will explain how to properly use CSS, for now we will stick with why you should use CSS.

Content and Design should always be separated. We have all heard this a million times but why do we not listen. The benefits to building a website following this method are proven.

1. Search Engines: I have redesigned many websites eliminating tables and placing all links in unordered lists and have seen there search engine rankings improve drastically.

2. Compatibility: Remember that in today's day and age websites are being viewed on everything from 60 inch plasma TV's to 3 inch cell phone screens. If you assign a table a width of 780 it becomes near impossible for visitor using a handheld device to view your website.

3. Accessibility: People with disabilities have the right to enjoy the web! If your website uses tables a visitor using an audio browser is going to have trouble accessing your website. Go ahead and try to use your website with and audio browser...

I hope this article gets you started on your way to becoming a Web Standards Developer. There are a million reasons to "Do it the right way" and these were just a few, for more information visit the w3.org.