<p>It seems like every time I try to create a pure CSS layout it takes me much longer than if I'd use a table or two. Getting three columns to be equal lengths with different amounts of data seems to require particular fancy hacks, especially when dealing with cross-browser issues.</p>

<p>My Question:</p>

<p>Who are these few tables going to hurt? </p>

<p>Tables seem to work particularly well on tabular data &mdash; why are they so reviled in this day and age?</p>

<p>Google.com has a table in its source code, so do many other sites (<em>stackoverflow.com does not by the way</em>).</p>

[{'answer_id': 5331, 'author': 'Seibar', 'author_id': 357, 'author_profile': 'https://Stackoverflow.com/users/357', 'pm_score': 3, 'selected': False, 'text': '<p>I\'m of the thought that CSS layout with as few tables as possible is cleaner and better, but I agree that sometimes you just gotta use a table.</p>\n\n<p>Business-wise, it\'s generally "what\'s going to get it done the fastest and most reliable way." In my experience, using a few tables generally falls into that category.</p>\n\n<p>I have found that a very effective way to mitigate cross-browser differences in CSS rendering is to use the "strict" doctype at the top of your page:</p>\n\n<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;\n</code></pre>\n\n<p>Also, for the dreaded IE6 CSS issues, you can use this hack:</p>\n\n<pre><code>.someClass {\n    background-color:black; /*this is for most browsers*/\n    _background-color:white; /*this is for IE6 only - all others will ignore it*/\n}\n</code></pre>\n'}, {'answer_id': 5332, 'author': 'palmsey', 'author_id': 521, 'author_profile': 'https://Stackoverflow.com/users/521', 'pm_score': 4, 'selected': False, 'text': "<p>Like a lot of things, it's a good idea that often gets carried too far. I like a div+css driven layout because it's usually quite easy to change the appearance, even drastically, just through the stylesheet. It's also nice to be friendly to lower-level browsers, screen readers, etc. But like most decisions in programming, the purpose of the site and the cost of development should be considered in making a decision. Neither side is the right way to go 100% of the time.</p>\n\n<p>BTW, I think everyone agrees that tables <em>should</em> be used for tabular data.</p>\n"}, {'answer_id': 5338, 'author': 'Ishmaeel', 'author_id': 227, 'author_profile': 'https://Stackoverflow.com/users/227', 'pm_score': 1, 'selected': False, 'text': '<p>Business reason for CSS layout: You can blow away the customers by saying "our portal is totally customizable/skinnable without writing code!"</p>\n\n<p>Then again, I don\'t see any evil in designing block elements with tables. By block elements I mean where it doesn\'t make any sense to break apart the said element in different designs. </p>\n\n<p>So, tabular data would best be presented with tables, of course. Designing major building blocks (such as a menu bar, news ticker, etc.) within their own tables should be OK as well. Just don\'t rely on tables for the overall page layout and you\'ll be fine, methinks.</p>\n'}, {'answer_id': 5339, 'author': 'Michael Stum', 'author_id': 91, 'author_profile': 'https://Stackoverflow.com/users/91', 'pm_score': 2, 'selected': False, 'text': '<p>The <em>idea</em> is that Designers can Design and Web Developers can implement. This is especially the case in dynamic web applications where you do not want your Designers to mess around in your Source Code.</p>\n\n<p>Now, while there are templating engines, Designers apparantly just love to go crazy and CSS allows to pull a lot more stunts than tables.</p>\n\n<p>That being said: As a developer, i abandoned CSS Layout mostly because my Design sucks anyway, so at least it can suck properly :-) But if I would ever hire a Designer, I would let him use whatever his WYSIWYG Editor spits out.</p>\n'}, {'answer_id': 5341, 'author': 'Justin Standard', 'author_id': 92, 'author_profile': 'https://Stackoverflow.com/users/92', 'pm_score': 3, 'selected': False, 'text': '<p>Keep your layout and your content separate allows you to redesign or make tweaks and changes to your site easily.  It may take a bit longer up front, but <strong>the longest phase of software development is maintenance</strong>.  A css friendly site with clear separation between content and design is best over the course of maintenance.</p>\n'}, {'answer_id': 5345, 'author': 'Jon Galloway', 'author_id': 5, 'author_profile': 'https://Stackoverflow.com/users/5', 'pm_score': 3, 'selected': False, 'text': '<p>Using semantic HTML design is one of those things where you don\'t know what you\'re missing unless you make a practice of it. I\'ve worked on several sites where the site was restyled after the fact with little or no impact to the server-side code.</p>\n\n<p>Restyling sites is a very common request, something that I\'ve noticed more now that I\'m able to say "yes" to instead of try to talk my way out of.</p>\n\n<p>And, once you\'ve learned to work with the page layout system, it\'s usually no harder than table based layout.</p>\n'}, {'answer_id': 5355, 'author': 'Dillie-O', 'author_id': 71, 'author_profile': 'https://Stackoverflow.com/users/71', 'pm_score': 0, 'selected': False, 'text': "<p>:: nods at palmsey and Jon Galloway ::</p>\n\n<p>I agree with the maintainability factor. It does take me a bit longer to get my initial layouts done (since I'm still a jedi apprentice in the CSS arts) but doing a complete revamp of a 15 page web site just by updating 1 file is heaven.</p>\n"}, {'answer_id': 5395, 'author': 'Brian Lyttle', 'author_id': 636, 'author_profile': 'https://Stackoverflow.com/users/636', 'pm_score': 0, 'selected': False, 'text': '<p>Some additional reasons why this is good practice:</p>\n\n<ul>\n<li>Accessibility - the web should ideally be\naccessible by all</li>\n<li>Performance - save\n    bandwidth and load faster on mobile\n    devices (these lack bandwidth to some\n    degree and cannot layout complex\n    tables quickly). Besides loading fast is always a good thing...</li>\n</ul>\n'}, {'answer_id': 5402, 'author': 'OJ.', 'author_id': 611, 'author_profile': 'https://Stackoverflow.com/users/611', 'pm_score': 3, 'selected': False, 'text': "<p>In my experience, the only time this really adds business value is when there is a need for 100% support for accessibility. When you have users who are visually impaired and/or use screenreaders to view your site, you need to make sure that your site is compliant to accessibility standards.</p>\n\n<p><strike>Users that use screenreaders will tend to have their own high-contrast, large-font stylesheet (if your site doesn't supply one itself) which makes it easy for screenreaders to parse the page.</strike></p>\n\n<p><strike>When a screenreader reads a page and sees a table, it'll tell the user it's a table. Hence, if you use a table for layout, it gets very confusing because the user doesn't know that the content of the table is actually the article instead of some other tabular data.</strike> A menu should be a list or a collection of divs, not a table with menu items, again that's confusing. You should make sure that you use blockquotes, alt-tags title attributes, etc to make it more readable.</p>\n\n<p>If you make your design CSS-driven, then your entire look and feel can be stripped away and replaced with a raw view which is very readable to those users. If you have inline styles, table-based layouts, etc, then you're making it harder for those users to parse your content.</p>\n\n<p>While I do feel that maintenance is made easier for <em>some</em> things when your site is purely laid out with CSS, I don't think it's the case for all kinds of maintenance -- especially when you're dealing with cross-browser CSS, which can obviously be a nightmare.</p>\n\n<p>In short, your page should describe its make-up in a standards compliant way if you want it to be accessible to said users. If you have no need/requirement and likely won't need it in the future, then don't bother wasting too much time attempting to be a CSS purist :) Use the mixture of style and layout techniques that suits you and makes your job easier.</p>\n\n<p>Cheers!</p>\n\n<p>[EDIT - added strikethrough to wrong or misleading parts of this answer - see comments]</p>\n"}, {'answer_id': 5417, 'author': 'Polsonby', 'author_id': 137, 'author_profile': 'https://Stackoverflow.com/users/137', 'pm_score': 3, 'selected': False, 'text': "<p>In the real world, your chances of taking one design and totally reskinning it without touching the markup are pretty remote. It's fine for blogs and concocted demos like the csszengarden, but it's a bogus benefit on any site with a moderately complex design, really. Using a CMS is far more important.</p>\n\n<p>DIVs plus CSS != semantic, either. Good HTML is well worthwhile for SEO and accessibility always, whether tables or CSS are used for layout. You get really efficient, fast web designs by combining really simple tables with some good CSS. </p>\n\n<p>Table layouts can be more accessible than CSS layouts, and the reverse is also true - it depends TOTALLY on the source order of the content, and just because you avoided tables does not mean users with screen readers will automatically have a good time on your site. Layout tables are irrelevant to screen reader access provided the content makes sense when linearised, exactly the same as if you do CSS layout. Data tables are different; they are really hard to mark up properly and even then the users of screen reader software generally don't know the commands they need to use to understand the data. </p>\n\n<p>Rather than agonising over using a few layout tables, you should worry that heading tags and alt text are used properly, and that form labels are properly assigned. Then you'll have a pretty good stab at real world accessibility.</p>\n\n<p>This from several years experience running user testing for web accessibility, specialising in accessible site design, and from consulting for Cahoot, an online bank, on this topic for a year. </p>\n\n<p>So my answer to the poster is no, there is no business reason to prefer CSS over tables. It's more elegant, more satisfying and more correct, but you as the person building it and the person that has to maintain it after you are the only two people in the world who give a rat's ass whether it's CSS or tables.</p>\n"}, {'answer_id': 5421, 'author': 'Polsonby', 'author_id': 137, 'author_profile': 'https://Stackoverflow.com/users/137', 'pm_score': 0, 'selected': False, 'text': "<blockquote>\n  <blockquote>\n    <p>When a screenreader reads a page and sees a table, it'll tell the user it's a table. Hence, if you use a table for layout, it gets very confusing because the user doesn't know that the content of the table is actually the article instead of some other tabular data</p>\n  </blockquote>\n</blockquote>\n\n<p>This is actually not true; screen readers like JAWS, Window Eyes and HAL ignore layout tables. They work really well at dealing with the real web.</p>\n"}, {'answer_id': 5423, 'author': 'Dillie-O', 'author_id': 71, 'author_profile': 'https://Stackoverflow.com/users/71', 'pm_score': 3, 'selected': False, 'text': '<p>One other thing I just remembered, you can assign a different stylesheet to a page for printing vs. display.</p>\n\n<p>In addition to your normal stylesheet definition, you can add the following tag</p>\n\n<pre><code>&lt;link rel="stylesheet" type="text/css" media="print" href="PrintStyle.css" /&gt;\n</code></pre>\n\n<p>Which will render the document according to that style when you send it to the printer. This allows you to strip out the background images, additional header/footer information and just print the raw information without creating a separate module.</p>\n'}, {'answer_id': 5429, 'author': 'Polsonby', 'author_id': 137, 'author_profile': 'https://Stackoverflow.com/users/137', 'pm_score': 3, 'selected': False, 'text': '<blockquote>\n  <blockquote>\n    <p>doing a complete revamp of a 15 page web site just by updating 1 file is heaven.</p>\n  </blockquote>\n</blockquote>\n\n<p>This is true. Unfortunately, having one CSS file used by 15,000 complex and widely differing pages is your worst nightmare come true. Change something - did it break a thousand pages? Who knows?</p>\n\n<p>CSS is a double-edged sword on big sites like ours.</p>\n'}, {'answer_id': 5474, 'author': 'Dave Ward', 'author_id': 60, 'author_profile': 'https://Stackoverflow.com/users/60', 'pm_score': 3, 'selected': False, 'text': '<p>If you have a public facing website, the real business case is SEO.  </p>\n\n<p>Accessibility is important and maintaining semantic (X)HTML <strong>is</strong> much easier than maintaining table layouts, but that #1 spot on Google will bring home the bacon.</p>\n\n<p>For example:  <a href="http://latimesblogs.latimes.com/readers/2008/08/colleagues-we-c.html" rel="nofollow noreferrer">Monthly web report: 127 million page views for July</a></p>\n\n<blockquote>\n  <p>Monthly web report: 127 million page views for July</p>\n  \n  <p>...</p>\n  \n  <p>Latimes.com keeps getting better at SEO (search engine optimization), which means our stories are ranking higher in Google and other search engines. We are also performing better on sites like Digg.com. All that adds up to more exposure and more readership than ever before.</p>\n</blockquote>\n\n<p>If you look at their site, they\'ve got a pretty decent CSS layout going.  </p>\n\n<p>Generally, you find relatively few table layouts performing well in the SERPs these days.</p>\n'}, {'answer_id': 5506, 'author': 'Michael Neale', 'author_id': 699, 'author_profile': 'https://Stackoverflow.com/users/699', 'pm_score': 0, 'selected': False, 'text': "<p>I don't think there is a business reason at all. Technical reason, maybe, even so, barely - it is a huge timesuck the world over, and then you look at it in IE and break down and weep.</p>\n"}, {'answer_id': 5530, 'author': 'Mike Minutillo', 'author_id': 358, 'author_profile': 'https://Stackoverflow.com/users/358', 'pm_score': 1, 'selected': False, 'text': "<blockquote>\n  <p>*I would let him use whatever his WYSIWYG Editor spits out<br>\n  I just threw-up a little...<br>\n  *ahh hello? You don't think the graphic designer is writing the CSS by hand do you?</p>\n</blockquote>\n\n<p>Funnily enough I have worked with a few designers and the best among them <strong><em>do</em></strong> hand-tweak their css. The guy I am thinking of actually does all of his design work as an XHTML file with a couple of CSS files and creates graphical elements on the fly as he needs them. He uses Dreamweaver but only really as a navigation tool. (I learned a lot from that guy)</p>\n\n<p>Once you've made an investment to learn purely CSS-based design and have had a little experience (found out where IE sucks [to be fair it's getting better]) it ends up being faster I've found. I worked on Content Management Systems and the application rarely had to change for the designers to come up with a radically different look.</p>\n"}, {'answer_id': 75488, 'author': 'Carl Camera', 'author_id': 12804, 'author_profile': 'https://Stackoverflow.com/users/12804', 'pm_score': 5, 'selected': False, 'text': "<p>Since this is stack<strong>overflow</strong>, I'll give you my <em>programmer's answer</em></p>\nsemantics 101\n<p>First take a look at this code and think about what's wrong here...</p>\n<pre><code>class car {\n    int wheels = 4;\n    string engine;\n}\n\ncar mybike = new car();\nmybike.wheels = 2;\nmybike.engine = null;\n</code></pre>\n<p>The problem, of course, is that a bike is not a car. The car class is an inappropriate class for the bike instance.  The code is error-free, but is semantically incorrect.  It reflects poorly on the programmer.</p>\nsemantics 102\n<p>Now apply this to document markup.  If your document needs to present tabular data, then the appropriate tag would be <code>&lt;table&gt;</code>. If you place navigation into a table however, then you're misusing the intended purpose of the <code>&lt;table&gt;</code> element.  In the second case, you're not presenting tabular data -- you're (mis)using the <code>&lt;table&gt;</code> element to achieve a presentational goal.</p>\nconclusion\n<p>Whom does this hurt? No one. Who benefits if you use semantic markup?  You -- and your professional reputation.  Now go and do the right thing.</p>\n"}, {'answer_id': 207148, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>i actually can see Tables in Stack Overflow on the user page. </p>\n\n<p>It even has heaps of inline styles...</p>\n'}, {'answer_id': 208308, 'author': 'Brad', 'author_id': 26130, 'author_profile': 'https://Stackoverflow.com/users/26130', 'pm_score': 1, 'selected': False, 'text': '<p>Besides being easily updatable and compliant...</p>\n\n<p>I use to design all table based web sites and I was resistant at first, but little by little I moved to CSS. It did not happen overnight, but it happened and it is something you should do as well.</p>\n\n<p>There have been some nights I wanted to toss my computer out the window because the style I was applying to a div was not doing what I want, but you learn from those obstacles.</p>\n\n<p>As for a business, once you get to designing web sites by CSS down to a science, you can develop processes for each site and even use past web sites and just add a different header graphic, color, etc.</p>\n\n<p>Also, be sure to embed/include all reusable parts of your website: header, sub-header, footer.</p>\n\n<p>Once you get over the hump, it will be all down hill from there. Good luck!</p>\n'}, {'answer_id': 208501, 'author': 'Vijesh VP', 'author_id': 22016, 'author_profile': 'https://Stackoverflow.com/users/22016', 'pm_score': 3, 'selected': False, 'text': "<p>The main reason why we changed our web pages to DIV/CSS based layout was the delay in rendering table based pages. </p>\n\n<p>We have a public web site, with most of its users base is in countries like India, where the internet bandwidth is still an issue (its getting improved day by day, but still not on par). In such circumstances, when we used table based layout,  users had to stare at a blank page for considerably long time. Then the entire page will get displayed as a whole in a tick. By converting our pages to DIV, we managed to bring some contents to the browser almost instantly as users entered to our web site, and those contents where enough to get the users engaged till browser downloads entire contents of the page. </p>\n\n<p>The major flaw with table based implementation is that, the browser we will show the content of the table only after it downloads the entire html for that table. The issue will blow out when we have a main table which wraps the entire content of the page, and when we have lots of nested tables. For the 'flexible tables' (those without any fixed width), after downloading entire table tag, browser has to parse till the last row of the table to find out the width of each columns, then has to parse it again for displaying the content. Till all these happens users has to stare at a blank screen, then everything will come to screen in a tick.</p>\n"}, {'answer_id': 394955, 'author': 'datasn.io', 'author_id': 49318, 'author_profile': 'https://Stackoverflow.com/users/49318', 'pm_score': 0, 'selected': False, 'text': "<p>There definitely is. If you are still striving for it, you are not getting it right.</p>\n\n<p>DIV+CSS layout is actually much easier than table layout in terms of maintainability and productivity. Just keep practicing it before it's too early to say that.</p>\n\n<p>Table layout is good too it's just not meant for layouts and have exceptional drawbacks when it comes to minor tuning.</p>\n"}]
['https://Stackoverflow.com/questions/5323', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/556/']