From the article: Don't Use Tables for Layout
There are lots of reasons that a Web designer might choose to use CSS for layout instead of tables. Why do you do so? Share Your Reason
I wanted change, I tried, I trashed css
- Try aligning complete sections within sections. Maybe tables were not meant for page layout but aligning other things then txt are a great pain in css. Maybe tables were not meant for creating layouts but I wonder if div tags were. Things get messy with css much quicker then with tables. It is not user friendly and it seems almost if the creators (also of this article) like to make it harder to code in texteditors. Maybe they like to sell "what you see is what you get" software? I have no idea. W3c deserves a huge thumb down for this css standard and depricating all kinds of commands that made aligning simple. I studied aligning for 4 days now. There is no simple w3c complying solution. what a stupid distaster.
- —Guest Jantje
cont'd
- 3) Using tables breaks the semantic/presentation separation rule, we are told. But how is coding (for example) a two-column layout with a table breaking it any more than two float: left divs? The designer has the desire to get two columns from his layout and he will hack around with his divs and floats till he gets that! He has broken the same rules, only rather more implicitly. 4) I get the strong whiff from all of this that this is simply coders preferring the intellectual exercise of forming layouts with divs/floats etc with obtuse and very delicate parameters. But that isn't what the game is. Making your code easier to understand later (and by others) *is* what it is about. Website markup is not a circle-jerk for designers. I would like to point out that several writers leaving comments here have been talking about a "tables versus CSS" argument. This is, of course, not the issue - you need CSS even with tables. It's a "tables versus divs" issue.
- —Guest Steve
The usual anti-table falsehoods
- 1) The "screen reader" reason often put forward on the side of the "don't use tables" brigade is false. It assumes that browsers for sight-impared people follow a: HTML (etc) --> speech process. That they are "speech browsers". This is not the case. They follow a: HTML (etc) --> screen presentation --> speech process - that is why they are called "screen readers". To such software it doesn't matter one fig whether your two-column layout has been achieved by two columns in a table, or two floated: divs. The software is simply reading the resulting screen layout. 2) I've seen ludicrous solutions for layout involving people nesting 3 or more divs, all with varying ghastly combinations of position:, display: and float: attributes to mimic layouts more easily done with tables. In a year's time are they going to understand what they did? Moreso, is another developer going to understand? Cont'd...
- —Guest Steve
Force IE to comply... eventually
- If it causes problems with IE, then it's probably worth the effort based on that alone. The more often people have display issues caused by IE's lack of conformity, the more likely they will switch browsers. Instead of hacking your own web pages to accommodate them, why not just speak the truth to readers? It could be similar to a link for non-java versions for viewers who can't read it. But the link would go to a list of alternative, free browsers and explain that IE is polluting the web through their noncompliance to W3C standards. "You must comply... resistance is futile."
- —Adam_K
How Much?
- I can't help but wonder, how much the writers of the CSS specifications paid the author of this article??? While tables may have their idiosyncrasies, they definitely have their place in overall, GOOD design in websites. I remember a time when the "Experts" stated that framesets were a terrible way to design webpages and that a designer should ALWAYS use tables... and recently, I heard the exact opposite of that statement... This article sounds like a sales-pitch for CSS... and let's face it, tables allow for MUCH better control over the layout of a page. Here is the reality... As with any programming or scripting, there are always multiple ways to accomplish any particular task. Find what works best for you, and do it. But Do NOT preach to the rest of the world that your way is better than someone else's. It's not better, it's just a different means to the same end. ******************************************************************* From Jennifer: to answer your question, the only pay I receive from these articles is from About.com. I am not paid to write ANY of the articles or reviews here. About.com has an Ethics Policy (linked at the bottom of every page on our site) that I take very seriously. Honestly, I was somewhat offended by your implication. You are correct that there are many different ways to do things on the web. Some are better than others. I believe that CSS for layout is better than tables, you disagree. That doesn't mean that you are in the pay of the people who wrote HTML 2 with TABLES. Yes, frames and tables used to be the recommendation, because there wasn't a better way to accomplish those goals. But times have changed. You can still use tables for layout, but that is not considered the best practice by most experts these days. Chances are CSS will be outdated for layout sometime in the future. That doesn't make it not the best choice right now.
- —Guest Alexandre
Website without Table
- we are doing website to reach people. Nowadays easiest way to reach the people is Search Engine. We have to consider SE when we create website. Everybody knew Google crawling method. So I can drop using tables for my layouts. I found some difficulties using float then i go with div combined CSS and list. I can apply only list and div for designing the website. But it has lot of restrictions and inconvenience for well designed layouts. So i am trying solve this problems and make websites with less code and simplicity.
- —sandywebforce
CSS should be better than tables
- To Bosch in particular, I agree that almost any useful layout can be achieved using tables, but they can often become more complex than the design seems to justify. I don't understand the point about designers and coders. Code is merely the means by which a design is implemented. CSS could supplant tables for layout if a small number of serious design flaws could be fixed. Most useful would be a means to specify the total size of a block, rather than the content size. I run into this problem regularly and have only been able to work around it by including tables. These defects seem to me to be so severe, and so obvious that I am surprised that they weren't picked up when the specification was first released, and that so few people seem to consider them important now.
- —chris_barry
Specifics
- I see opinions expressed with determination but weakly defended. I present an example. Consider: div.outer{display: block; position: absolute; width: 50%; left: 20%; height: 10em; background-color: #F00;} div.inner{display: block; position: absolute; top: 2em; left: 0; width 100%; height: 4em; padding: 1em; background-color: #0F0;} In the HTML place inner within outer. The intention of the above should be obvious, and I think, models a common requirement. In response to what actually happens I say firstly that a container which allows its contents to flow beyond its boundaries has failed in its primary purpose, and secondly, what conceivable value is there to this behaviour anyway. The desired result can be obtained easily by using a table within the inner block and setting the padding to 0. I challenge anyone who believes the CSS specification to be sensible to show how this can be achieved using only CSS.
- —chris_barry
CSS is almost unusable for page layout
- Who is responsible for the CSS specification? I do not usually favour ad hominem attacks, but in this case it is necessary. These people are idiots. eg: Percentage sizes should be calculated after deducting fixed sizes. Block widths should be overall, not client area. A block should never project beyond the edge of its container. Width: auto; should result in the block staying within its container when left: !=0;. If a block has a height and its container has none then the containers height should be set to allow at least enough room for the contained blocks. These defects make it very difficult to create pages that adapt sensibly to different sized browser windows. Tables are not perfect but they are better. They should not be. These faults of CSS are blatantly obvious and should have been fixed before the specification was released. [[From Jennifer: not all of these are faults of CSS, but rather of how the browsers render the styles.]]
- —chris_barry
CSS is stupid
- yeah CSS is totally stupid hard to use it takes to long and to be honest i think you can get just as good a look using html faster and more easily
- —Guest MrTurner
How about combining CSS with Tables?
- I've been developing websites since 1998, like one of the designers who commented here. I agree that DIVs are great, easy and no-hassle elements. However, when it comes to precision, one either must use a javascripts, separate CSS files and tags from IE, IE6, and -moz adjustment and so on. In my work, all my headers and footers and wrappers are made out of DIVs, but when it comes to precision like making 2 columns lay equally in height, I use Tables. Before I was ashamed to admit it actually, and spent hours and hours looking for ways to make CSS alone work. However, soon enough, I figured, wait a minute, all these reasons why NOT to use Tables are nonsense. I am sorry, I'm sure SEO is fine if there are few Tables, and XHTML valid, well, do you think my clients really care about it? They want the precise look! With no extra coding and javascript. So I believe that Tables will be back in fashion one day. I mean, we still make pages for IE6, why not to use what works everywhere?
- —Guest Arkadi
clear view
- Ive been in web design since 1998. and tables were my main layout tool. To the point that i can control every aspect or issue that people consider difficult. I am truly struggling to find a reason why css for layout is "superior" CSS for layout is not designer friendly at all. it was developed by coders for coders. Coder thought process for web pages is number related. they see a box which has to have borders and padding and margin. oh images, lets bup borders around and align left weee. this isn't how designers approach design, we are just forced to. if argument is that tables weren't designed for layout then neither unordered lists for menus. This CSS for layout craze is biased bullcrap. /out
- —Guest Bosch
CSS for life
- css changed the way i see and use the web.. clearly its every reason im into web design; its easy, fast, seo friendly and its free :P
- —Guest inkfree
CSS is great, but...
- I agree, CSS is great. But for greater browser compatibility, tables are still the tool of choice. Not until CSS is standardized across the browsers spectrum shouldy ou make the leap entirely into CSS.
- —Guest Makes Sense
css
- Just threw myself into the world of code but can easily see that css dominates tables for layout!
- —Guest newkid
1-15 of 24Next

