Forum Moderators: phranque

Message Too Old, No Replies

CSS vs Tables

Can a CSS pure site have a table?

         

nigassma

7:09 pm on Jun 14, 2005 (gmt 0)

10+ Year Member



To save headaches and fixes and what not, I've seen a few sites that use one table to contain content and style the rest of the page with CSS. Personally, I wouldn't do that because of the problems I've experienced with tables, but I was wondering what other developers thought about using a table in their sites.

karmov

7:34 pm on Jun 14, 2005 (gmt 0)

10+ Year Member



We've got a table-less layout but we still use tables in there. The reason you ask?

"Tables should be used to mark up truly tabular information ("data tables"). Content developers should avoid using them to lay out pages ("layout tables")." - W3C

We have some data that is tabular. It may be the case that these sites you're looking are using them for tabular data.

If they're not, all I can say is that in some cases it is a lot easier to use a table to deal with a lot of cross-browser issues. The table-less layout would not be anywhere near as hard if all the browsers rendered CSS one way, but they don't. We put a huge amount of time and effort reducing all of the cross-browser issues to near zero. Having gone through it, I wouldn't expect many people to put in that same effort, especially when it comes to that last table that you're trying to get rid of and just can't make it work...

nigassma

7:48 pm on Jun 14, 2005 (gmt 0)

10+ Year Member



The sites usually use the table to solve the cross browser difficulties that we've all drug our feet through. Not for tabular data.

eeiioo

8:57 pm on Jun 14, 2005 (gmt 0)

10+ Year Member



W3C may have denounced tables for layout purposes, but their recommendations are generally based upon the long term "ideal internet." Current real life situations are not necessarily taken into account by them.

There are some webmasters who aggressively follow every W3C recommendation. I can't help but think these people are likely site building hobbyists.

Do your browser and platform testing and go with what works for you.

tedster

2:25 am on Jun 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



After developing a few table-free sites for clients last year we felt that, given the current browser situation, it was not a yet a practical approach for us. Development and testing just take TOOOOOOOO long.

So we've taken exactly the approach you outlined. The basic frame of a layout is done with (usually one) table and everything else is CSS. We write html 4.01 strict and we validate the pages as well as test them cross-browser and cross-platform ... so we're far from just writing lazy mark-up.

I highly admire the pioneers who are working through all the cross-browser craziness that makes CSS-P so challenging. I just can't afford the time and restrictions it currently takes.

rjohara

2:35 am on Jun 15, 2005 (gmt 0)

10+ Year Member



It's interesting that now the New York Times, not a site you'd think of as an early adopter, has gone mostly table-less for its article pages. The nytimes.com home page is still a big mess of nested tables, but if you look at any interior story most everything is done with DIVs (except for some ads and other small bits). If you view an interior page with CSS turned off you'll see a message "Why does the page look like this?" (Answer: because your browser didn't access the style information for the page.)