Tables versus CSS
There’s a debate in web development circles that has been going on for years. On one side, you have the traditionalists who prefer tables for layout purposes. On the other, you have the CSS purists who prefer to separate display from content completely. I’d say the latter group has been winning the debate lately, although both sides make a valid argument.
Personally, I find it pointless to argue over which is inherently better than the other. It’s really just a matter of personal preference. Each has strengths and weaknesses, with the only differences in performance depending on the situation. Despite what some CSS purists will tell you, there are situations in which you’re better off with a table-based layout, and vice versa. Here are the pros of each method as I see it.
Benefits of Tables
- Tables are simpler. You can lay a site out faster and debug problems more easily with tables than with CSS. For the novice developer, tables also have a much nicer learning curve.
- Tables have more cross-browser compatibility. Whereas CSS must often be hacked to account for different browsers, tables usually display the same no matter what browser is rendering them.
- Tables are great for tabular data. Layouts aside, tables are the method of choice when it comes to displaying data in a spreadsheet- or grid-like format. The markup in this case is less cumbersome and more intuitive than its CSS-based equivalent.
Benefits of CSS
- CSS is more maintainable. Especially with larger sites, being able to control all display elements from one file saves a lot of time and hassle. Redesigning a website with a static, table-based layout, on the other hand, can often be just as bad as building it from scratch.
- CSS is more accessible. Ordinary browsers aren’t the only programs looking at a website. CSS tends to make a site much easier to read for non-visual browsers as well as search engine spiders.
- CSS is the professional standard. Anyone heavily involved in web design knows that CSS-based layouts are expected. Using tables for layout nowadays is often considered lazy or unprofessional.
Honestly, I’m a fan of both. Anyone looking at the source code of Project Paradox will see that it’s a hybrid. Like any good web developer, I care more about results than coding paradigms. Thus, I use CSS whenever possible, but I’m not afraid to fall back on tables when CSS would be more cumbersome. No doubt some purists will disagree with this. As I see it, though, when you keep your eyes on the final product without being constrained by design philosophies, your websites will be better and your clients will be happier.