One of the debates that never seems to go away in the web development community is that of css vs tables and which is better to use for the layout of your site. I’m surprised this debate continues, though admittedly I’m continuing it right now after the question was raised on my small business forum. I think much of the reason css vs tables is still debated is the misinformation people on both sides put out there. Hopefully I can clear up a few things in this post and let you make your own decision.
Let me start by letting you know I fall on the css side of things. Having developed and worked on sites both ways I’m 100% certain structuring your layout with tables is not the way to go. However, you can build a great site using tables and a poor site using css. To compare we really need to look at sites that are well developed on both sites.
Let me also say that if you prefer to develop sites with a table-based layout, good for you. I’m not going to tell you that you’re doing anything wrong or evil or that the world is going to come to an end. I do think css is the better option, but feel free to develop sites any way you want.

photo credit: Marjan Krebelj
What This Debate is Really About
Calling this debate css vs tables is actually inaccurate. You can use css with a table-based layout. One argument the css side always uses is that having your presentation in a separate file makes the site easy to maintain. That is true, but you can have all your presentation in a separate css file while having a table-based structure to your html.
If you originally decide all your h1 tags should be blue and later want them to be red it’s certainly easier to have your h1 style sitting in a single css file. You can do that regardless of how you structure your layout. That would be a debate between using css or html attributes for presentation. I don’t think anyone is arguing in favor of html attributes.
What the css vs tables debate is really about is whether or not to structure a web page with tables or divs. In its simplest form we’re comparing:
<table> <tr> <td>Some content here</td> </tr> </table>
and
<div>Some content here</div>
The Problems with Tables
Even in the simplest case above you can see tables are already a more complex structure than divs. We needed three sets of tags to present some content as opposed to the one set of div tags. As we add more to the page’s design the table complexity continues to increase compared to divs.
In the best case scenario you’d be adding at least another table cell to get another block of information compared to adding another div for another block of information, which would grow our code equally. Most of the time though, that relationship won’t be 1:1. It will usually involve adding more tags on the table side as compared to the div side.
More code leads to more potential for errors. Software developers have known that for years and it’s equally true of the code used to develop a web page or site.
That brings us to the second problem with tables. They impose a more rigid structure than divs. Every table cell is dependent on the other table cells in its row to maintain the structure. Divs can work independently from each other. You can’t pluck a single cell out of a table and move it somewhere else in the layout. You can’t break out of the rigid grid easily. You can with a div.
Suppose you have a typical two column layout (content and sidebar) and you wanted to reverse the order. Maybe you want to move the sidebar from the left to the right of the content. With a table-based layout the only way this would be possible would be to go into every page of your site and change the underlying structure. With a div-based layout you could make this change in your stylesheet alone. Granted it’s not the kind of change you’re likely to make, but as an example it shows the greater flexibility and control you have in developing with divs.
The third problem with tables is in how browsers render them. In order for a browser to render a page built with tables it needs to read the code on the page twice. Once to understand the structure and another time to present it. That extra pass at the code makes table-based layouts take longer to display. With a simple table structure the extra time might not be noticeable, but as the structure becomes more complex with more and more tables nested inside each other it is noticeable.
If you ever visited a page that showed nothing for a few seconds before everything suddenly appeared, that time was likely your browser making it’s first pass over the table structure behind the page.
The Advantages of Divs
The advantages with using divs are essentially counter to the problems with tables described above. A div-based layout is:
- easier to maintain – less code and less complexity to the structure makes things easier to find and change.
- more flexible – since one div is not dependent on the other divs on the page it allows for more freedom in your design
- quicker to load – blocks of code can be presented right away instead of the browser requiring an extra pass
That might not seem like a lot, but just those three things are enough to make a div based approach better to a table based approach. Now let’s get to some of the myths on both sides that keep this debate going.

photo credit: Detlef Schobert
Myths About Divs and Tables
I mentioned at the start of this post that misinformation spreads on both sides of this debate. As people combat these myths the debate goes on and on combating misinformation while dancing around the central issue. Let’s see if we can dispel a few myths from each side
- CSS (divs) are better for SEO – Search engines don’t care one bit if the code behind your page uses tables or divs. Search engines are interested in your content, not your code. It’s true that less code means less potential for show stopping errors, but those show stoppers can exist regardless of your site’s structure.
Some might argue that the content search engines see on the page is more important and through divs it’s easier to present a different order of content to visitors and search engine spiders. It is easier with divs, but it can also be done with tables.
- CSS (divs) are more accessible – Both tables and divs can be coded to be accessible or inaccessible. You’ll have more control over how your page displays with divs that can aid in how a screenreader sees your content, but again you can create equally accessible pages using either approach
- CSS (divs) is hard to learn – Simply not true. CSS is not hard to learn.The argument is made by people comparing learning something new to learning something they already know well. That’s not an apples to apples comparison. Laying out a site with divs has a learning curve. So does laying out a site with tables. The problem most people have when learning to use divs is trying to force them to act like tables instead of allowing them to be what they are.
Even if we accept the argument that learning to use divs is difficult that doesn’t make tables a better approach. The best things in life are not necessarily easy or easy to learn. Not doing something because it takes time to learn is laziness.
- CSS (divs) requires too many hacks to work cross browser – Entirely false. Perhaps it’s a matter of experience, but if you know what you’re doing you never need to use any kind of hack. It’s been years since I wrote more than a few lines of code specifically for any one browser and none of that code is a hack.
If you develop to standards at most you’ll need to tweak a few things for Internet Explorer and usually only older versions of IE. If you find yourself needing hacks then most likely you haven’t thought out your structure all that well.
- It’s quicker to develop with tables – Nope. I guarantee I can develop a page with divs quicker than you can develop it with tables. This argument usually includes the time taken to learn to use divs, which isn’t a fair comparison. Take two developers, one who is fluent with tables and one who is fluent with divs, hand them a layered PSD file and ask them to code a web page to see who finishes first. My money will be on the person using divs.
Conclusion
This is one of those debates that never seems to go away and I guess I’m not exactly doing my part to make it go away with this post. I find it hard to believe that anyone who honestly knows how to develop a site well with both tables and divs would ever choose to use tables. Having used both it’s very obvious to me that the div based approach is the much better way to go.
There are a lot of myths propagated by both sides in this debate, but once you cut through most of them the argument really boils down to a few things.
Divs require less code and are less dependent on each other than tables. That leads to easier maintenance, more freedom in design, and quicker load times. Those arguments alone should be enough to tip the scales in the argument. Everything else is really irrelevant.
Subscribe to
TheVanBlog |
Email This Post












I feel like one of the reasons that tables are still so widely used are the WYSIWYGs. Learning CSS/div coding seems a daunting task because they dont really know the code in the first place.
I think anyone that codes by hand knows that CSS/div is easier to work with in that way.
If there is anyone that actually codes full table-based websites by hand I would be curious to know what reasoning they have for not switching.
You might be right about the WYSIWYGs.
When I first learned how to develop a website I learned to build them with tables like so many others. Then I had to make changes to one site and thought there had to be a better way.
Enter css and I’ve never looked back. To me it seems so obvious that using divs over tables is the better approach that I have a hard time understanding how someone would argue otherwise.
But clearly there are many people who support using tables. If you click through on some of the links in the post or just do a search for css vs tables you’ll come across a lot of the reasoning why some prefer tables. I don’t agree with their reasoning, but it is there.
“he argument is made by people comparing learning something new to learning something they already know well.”
I think you hit the nail right on the head with this comment. CSS based design is unquestionably superior to table layout, but due to sheer laziness the practice of table design has held on. I find that unfortunate, as someone who caught the tail end of the “table era” I find it much more difficult to maintain a website which uses tables (because of my own lack of experience with tables I suppose) than to administer a website which uses a CSS layout.
Very informative article and I hope that it gains some traction so people will stop using so many tables for layout.
I feel the same about maintain tables-based sites. I’ve worked with both, though certainly more with css sites. What makes tables harder is that it’s too easy to get lost in the structure and edit the wrong cell.
Top to bottom you seem to sum it up pretty well. I’ve never read about this debate until now, however in the back of my mind I always knew someone(s) was debating it.
I too started out doing HTML with tables, and as soon as I saw the CSS light, I’ve never been able to see it any other way. The only time I ever use tables anymore is to quickly horizontally and -vertically- oppose an image or something else on a temporary coming soon type page.
One debate I’m honestly curious about is the best way to go about table type content with CSS, such as using the actual table properties, using display: inline, using float: left, etc — where’s that write up? (i know there’s gotta be one but that’s almost another argument for CSS over tables… multiple ways you can go about it even).
Thanks Kevin. This debate has been going on for years. Do a search for css vs tables or similar and you can find a lot out there.
When you ask about table type content with css do you mean using css to show tabular data or are you asking more about how to style tables?
If you’re asking about the former then I’d say go ahead and use a table when you’re presenting data in columns and rows. If you’re asking about the latter that’s a good question. Maybe I’ll have to write a post on styling tables. I’m sure there are a few out there already, but one more won’t hurt.
It amazes me that some folks still use tables for layout in this day and age. Back in 2003, I gave my presentation, Why tables for layout is stupid, at Seybold (http://blog.hotdesign.com/2008/10/what-is-css/) about the advantages of CSS layouts. And, if anything, those advantages are more pronounced now than ever. Heck, even IE8 does a decent job of rendering CSS layouts.
As I see it, table layouts have precisely two advantages:
1. Outlook 2007 has a brain-dead rendering engine, so if you’re producing HTML e-mails, you need to use tables.
2. Table cells are the only elements in HTML that expand and contract based on adjacent content.
That’s it. If you’re not creating HTML e-mails, or unless you have some overriding need to have part of your page scale because of the amount of content on other parts of your page, there’s no reason to use tables for layout.
I hear you Bill. I’m amazed this conversation still exists yet it seems every few weeks I see another post proclaiming we should all go back to using tables for site layout.
Nice presentation by the way. The comics are great.
The one that continues using tables is because it does not dominate or does not know CSS. To design in CSS is far better, by the subject of order, maintenance, accessibility, navigability and thousand reasons more.
My thoughts exactly.
My homepage is currently structured with divs. It was easy to do, and it looks great in Opera, Firefox, and Chrome, but guess what?! IE sucks and makes my page look a pile of crap. I need to write special code for IE? How is that more maintainable?
I’d rather switch my page to tables, than screw around with IE. I don’t even have a copy of IE to work with. I agree that CSS is much better in theory, but as long as people use IE and Microsoft refuses to be standards compliant, I don’t think CSS for structure is the greatest idea.
Just because you didn’t get it working on your site, don’t blame css as though you can’t build a site that works across browsers. This site uses css and works in IE for example as do many, many others.
IE is a lot more standards compliant than you’re giving it credit for. It certainly lags behind other browsers, but for the most part IE fro version 7 on is css2 compliant.
CSS is better in both theory and practice. You do have to put in a little time to learn how to layout a site with css, but once learned it’s not hard to do.
I can understand your frustration, but it’s not the fault of css. Many people are able to build sites using css as a layout and getting them to work cross-browser including IE without any difficulty.
I come from a developer background and am now working as an SEO consultant (I know, Boooo and all that) so I am definately an advocate of divs and I have to disagree with:
‘Search engines don’t care one bit if the code behind your page uses tables or divs. Search engines are interested in your content, not your code.’
I agree to an extent but I have here 2 very good reasons why tables are definately worse for SEO:
1. Accessibility issues arise more frequently due to excessive coding – ok so this can be attributed to bad coding but it’s such a common issue that it has to be taken into account
2. As you mentioned, pages built in tables have to load twice (something I didn’t know until reading this post) add to this that the example you showed:
Some content here
and
Some content here
clearly illustrates how much extra code is required for tables. With many sites (big, e commerce sites for example) having many different sections of text and images and other media throughout a page the code just grows and grows, taking browsers longer to load page content.
With Google’s latest algorithm update (Caffeine) emphasising page load times as a SE ranking factor it is now more important than ever from an SEO stand point to reduce the amount of code on a webpage.
You make good points. As far as the speed issues, Google didn’t really talk about load times affecting ranking until after I wrote this post. Now that they have indicated that load times will be a ranking factor I would agree that divs make more sense.
I’m not disagreeing with anything you say. I guess I’ve never been convinced of the seo benefits. Even though I think css is the better way, I’ve seen some very poor and slow loading css driven sites and some pretty well coded and quick table driven sites.
I think there’s more potential for errors with tables, but I know there are people who can code a search friendly site that’s still table-driven. I would never develop the site that way, but I know there are people who can. You can still develop an accessible site with tables. Even thought there’s more potential for errors, it doesn’t mean there will be errors.
The load time though, is now reason enough to recommend css over tables for seo. I just wrote this post a couple months before Matt Cutts mentioned how some at Google were pushing for that to be a factor.
By the way sorry the code in your comment didn’t display. I’m not logged into the site right now, but next time I am, I’ll see if I can fix it. The secret is you have to use < and > for the angle brackets or it gets interpreted as actual code. You can probably also wrap the code in a blockquote.
Great debate. I would have to say,use divs and tables for what they are designed for. If you want your page to behave like a table or part of it, use a table.
For instance, if you want colmns with different colour backgrounds to be the same length, use a simple table and style it with css. Then you can use divs inside your table.
I have nothing against using tables. In fact I use them all the time when I want to present data. The key issue is not to use tables for the layout of your site template. That’s always going to be better done using css.
What others are saying about this post
CSS vs Tables: The Debate That Won’t Die | Design Newztripwire magazine | tripwire magazine
Tweets that mention CSS vs Tables: The Debate That Won’t Die | Van SEO Design -- Topsy.com
70 Awesome Articles for Designer and Developers | tripwire magazine
70 Awesome Articles for Designer and Developers | huibit05.com