3

Duplicate: Tables instead of DIVs and Why not use tables for layout in HTML?

I am working on building a web app using ASP .NET MVC (needs to run on IE 7, FF 3.0), does it matter if I were to use tables rather than css for positioning and design?


As a developer I haven't had a chance to work with css.

Community
  • 1
  • 1
Developer
  • 17,809
  • 26
  • 66
  • 92

4 Answers4

4

Yes, it matters. The most convincing argument that I've used in favor of CSS over tables is that screen readers (for the visually impaired) trip over tabular layout. That's a good argument by itself, but it gets a whole lot better when you take into account the fact that Google reads your web site just like a screen reader would. If you want Google to have an easier time indexing your site, use CSS for layout. Tables are for tabular data.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
2

Use tables when you really do want to show tabular data.

Otherwise you really ought to be using CSS for your layout.

The main reason is that CSS works better for "unusual" browsers like the following:

  • Mobile browsers/smart-phones
  • Search engines
  • Screen readers for the visually impaired

If you work for the US Government that last one is a legal requirement.

Also see these questions:
Tables instead of DIVs
Why not use tables for layout in HTML?

Community
  • 1
  • 1
Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
  • I do not work for the government and so designing for mobile or visually impaired is not a priority. – Developer Dec 16 '08 at 17:41
  • 1
    Google is visually impaired. It should be a priority. – Bill the Lizard Dec 16 '08 at 17:42
  • _Any_ public web site should be concerned with those: more and more people are browsing from smart phones. Keeping the disabled in mind is just the right thing to do, especially when there's really no extra work involved. – Joel Coehoorn Dec 16 '08 at 17:43
  • Good point, Bill. Updating... – Joel Coehoorn Dec 16 '08 at 17:43
  • What's odd is that neither of you (and you're pretty high up in the Rep-arena) thought to close the question, even though it *must* have been hashed out at least once before. – George Stocker Dec 16 '08 at 17:49
  • I don't close duplicates- it's a waste of time. – Joel Coehoorn Dec 16 '08 at 17:52
  • Does it really take more time to keep the community clean of cruft than it does to answer this question? – George Stocker Dec 16 '08 at 18:00
  • @Gortok: If it's any consolation, I smacked my forehead when I saw the question get closed. I should have thought of it. :) – Bill the Lizard Dec 16 '08 at 18:02
  • I'm really trying to be charitable, but sometimes it feels like the 'higher ups' do things just for Reputation (though I concede that at your level, 20 more points won't make a bit of difference). Don't take it personally. I even have both of you on my RSS feed because of helpful answers. – George Stocker Dec 16 '08 at 18:04
  • This time it was just poor judgment on my part, no diabolical scheme to get more reputation. :) – Bill the Lizard Dec 16 '08 at 18:22
  • You misunderstand me: I believe that trying to keep up will all the duplicates is not only futile but ultimately counter-productive. A newbie who opens a duplicate that is immediately closed will likely never come back. – Joel Coehoorn Dec 16 '08 at 20:20
  • @Joel: You make a good point. Do you think we should just link them to the right question and ask them to close it themselves? – Bill the Lizard Dec 16 '08 at 22:15
2

Apart from all the "tables are evil" school of thought, you'll find it much easier to change the design in the future if you use pure css layout.

In addition, your mark up will a whole lot simpler and easier to "read".

Take a look at css. It shouldn't take more than a day to get up to speed.

user46702
  • 43
  • 6
1

Yes if your application UI needs to be of high standards. No, if you are just learning to master some adhoc concept or coming up with a quick prototype. Benefits of CSS vs. Tables are well discussed. With CSS, a web site become more agile and accessible, have a look at CSSZen garden.

On a side note, HTML DOCTYPE declaration and validation are equally important. Lest you would spend time fixing styles for every browser

questzen
  • 3,260
  • 18
  • 21