tags:

views:

289

answers:

4
+1  Q: 

Tables vs CSS

Duplicate: http://stackoverflow.com/questions/30251/tables-instead-of-divs#30271 and http://stackoverflow.com/questions/83073/div-vs-table#83121

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.

+2  A: 

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:
http://stackoverflow.com/questions/30251/tables-instead-of-divs
http://stackoverflow.com/questions/83073/div-vs-table

Joel Coehoorn
I do not work for the government and so designing for mobile or visually impaired is not a priority.
Nick
Google is visually impaired. It should be a priority.
Bill the Lizard
_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
Good point, Bill. Updating...
Joel Coehoorn
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
I don't close duplicates- it's a waste of time.
Joel Coehoorn
Does it really take more time to keep the community clean of cruft than it does to answer this question?
George Stocker
@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
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
This time it was just poor judgment on my part, no diabolical scheme to get more reputation. :)
Bill the Lizard
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
@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
+1  A: 

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.

If SO allowed me to mark multiple answers as right I would have marked yours as well. Thank You
Nick
+3  A: 

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
A: 

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