CSS? Tables?
June 23, 2006 2:15 AM   Subscribe

Should I feel bad because I use tables instead of CSS?

Sometimes I feel guilty because I use tables for layout in the sites I build. Everywhere I look they say "Don't use tables; use CSS". However, CSS requires so much hacking to ensure compatibility across browsers that I wonder if there's some kind of snob thing going on: "I'm using CSS so I must be thoroughly modern."

Yes, with tables there may be an extra few kilobytes of code to download, and I may have to enter the odd
tag and spacer image here and there, but the extra file size is minuscule compared to downloading even one jpeg.

And then they say that when IE7 is released a whole lot of those CSS hacks are going to be broken anyway... well, why should I bother?

I use CSS for formatting, so I'm not afraid of it, but I get great, easy, re-usable results using tables. What's not to like?
posted by TiredStarling to Computers & Internet (32 answers total) 3 users marked this as a favorite
 
No.
posted by beth at 2:24 AM on June 23, 2006


Yes.
posted by justgary at 2:47 AM on June 23, 2006


Seriously, what is the point of this question? The only person who your choice could possibly inconvenience is you. Find something else to feel bad about.
posted by aubilenon at 2:49 AM on June 23, 2006


I feel the more important question is: Will your professionalism suffer if you dont move with the evolving technology and standards of the internet?

I know fully well that they can be a pain in the arse at times, but personally I feel that if you wait too long you will be left will many technologies in the field that you need to learn and eventually become overwhelmed.
posted by a. at 3:03 AM on June 23, 2006


An interesting point that I use is that the RNIB (Royal National Institute for the Blind), who are very big on accessibility, still use tables, albeit basic ones, for layout even though there's nothing on their site that couldn't be achieved with a pure CSS layout.

Regarding IE7, developers are going to need to start separating their hacks into separate files to ensure backwards compatibility with < ie6.br>
Me, I use pure CSS for layout and presentation.
posted by TheDonF at 3:14 AM on June 23, 2006


An old aphorism: "a stupid solution which works isn't stupid."

I think this article is required reading when it comes to this kind of argument. (It's also quite funny IMHO.)

From the Devil's Dictionary 2.0:
web standards: A large stick or cudgel, used by the slightly more anal-retentive to beat the slightly less anal-retentive.
posted by Steven C. Den Beste at 3:15 AM on June 23, 2006 [2 favorites]


< ie6.br>
should have been less-than-or-equal-to.
posted by TheDonF at 3:19 AM on June 23, 2006


There's relatively little hackery involved in CSS layouts nowadays. Don't you want to learn new stuff all the time? Improve your skills? Build better sites?

Get yourself up to date and you'll be able to have a bit more pride in your skills and you work.
posted by malevolent at 3:24 AM on June 23, 2006


Response by poster: Thanks, Steven C. Den Beste. That article is exactly the sort of thing I'm looking for.
posted by TiredStarling at 3:29 AM on June 23, 2006


Don't feel bad. You should try to understand how and why things are done with CSS, but whatever works for you works.

You should try to use the minimal amount of tables, though, as they disrupt the flow of information in the page and make it difficult for screen readers, mobile devices, and text-only browsers. If you're just using tables to make columns, no big deal. CSS sucks for columns still.
posted by beerbajay at 3:43 AM on June 23, 2006


Nope. Minimal table is okay, even CSS Jedi Eric Meyer uses some in one of the chapters of his first book.
Just don't use heavy tables, or worse, tables into tables (into tables...).
posted by XiBe at 3:47 AM on June 23, 2006


(oh, and to answer the question: no if they're you're own sites, yes if you're being paid. Any web developer still making a living from churning out ye olde table-based layouts is the equivalent of a 'cowboy builder')
posted by malevolent at 3:54 AM on June 23, 2006


The biggest problem with tables from my point of view is that they rapidly become unmaintainable. What's the next guy gonna have to do to modify that site you just built?

If the answer is "not too much," then you're probably ok.
posted by joegester at 4:22 AM on June 23, 2006


Check out the /IE7/ JavaScript library.
posted by Sharcho at 4:26 AM on June 23, 2006


OMG!!!eleventy!! They are totally going to revoke your site building licence!

I would say use tables for (obviously?) blocks of data, and maybe to achieve a 3 column layout - but the rest can be done with css layout positioning with really hardly any major hacking at all.

Isn't part of the fun of problem-solving and learning learn techniques one of the best aspects of building sites? As malevolent said - keeping up to date and being able to do things really does give you pride in your work. Sure it's tough and frustrating sometimes if you can't work out why a floated div is misbehaving - but it feels so good when it slides right into place.

A quick googling will reveal a stack of articles focusing on just this discussion. Most of these were written in 2004. 2 years being a long time in web development - hardly anyone is writing articles about this issue any more as it's been accepted that tables are out and css is in. Look at the major blogging platforms - all of them are css layouts. And it's certainly easier to deal with a modular content management system when you are using css for positioning.
posted by gomichild at 4:36 AM on June 23, 2006


For what it's worth, Jamie Zawinski doesn't care for CSS.
posted by TedW at 5:11 AM on June 23, 2006


Seriously, what is the point of this question? The only person who your choice could possibly inconvenience is you. Find something else to feel bad about.

I'm suprised nobody has mentioned this but what about people using screen readers? Tables can make it almost impossible for them to work properly with the page. Accessability is a big thing these days.

Also, I surf a decent amout on my Treo in sub 56k speeds. All the text loads first, then images and styles. Pages that validate tend to work much better than pages that don't.

Beerbajay said the same thing, but I typed it up already so it's gettin' added.
posted by Brainy at 6:38 AM on June 23, 2006


Are you building these sites for yourself? If so, I say it doesn't matter. If you are building for clients, they might think you unprofessional if someone happened to point it out. Say, for instance, one of their customers is a web designer and comes along and says, "Do you know your site isn't built on web standards?" All the client knows is this sounds important and you didn't do it. Also, if you are building for clients, someone else might have to come along later on and take over the site. I hate taking over a table-based site because I invariably have to rip out the tables and recode the CSS (because I'm one of those anal-retentive bastards mentioned above).

My other question is why you want to use tables instead of CSS. Is it for convenience? Predictability? Something else? If it's for convenience alone, I would say you have to at least learn to work with CSS-based layouts. Try building your next site (start simple) with only CSS for layout and see how it goes. Start for instance with a simple header-leftsidebar-maincontent-footer site and see what all the fuss is about. If you still like tables after that, be prepared to defend that decision to both clients and colleagues.
posted by jxpx777 at 6:53 AM on June 23, 2006


If you don’t feel bad for using outdated development practices, we can make you feel bad if you like.
posted by joeclark at 6:54 AM on June 23, 2006


I use tables for doing the overall structure of a page layout, like three columns, etc. I then use CSS to define every aspect of the table cells. You don't need to use nested tables any more, just raw table cells with class or id definitions. I also use floats and divs when I can.

But the bottom line is that I can structure a site in tables in 5 minutes, or smash my head against the wall for days trying to make it work in divs. CSS isn't ready yet, it's still too complicated to make things work.
posted by fcain at 7:00 AM on June 23, 2006


CSS isn't ready yet fcain isn't ready for CSS yet, it's still too complicated to make things work.

Use tables for data in rows/columns.
posted by badger_flammable at 7:28 AM on June 23, 2006


Oh, please. CSS is not just complicated, it's broken by design. When "clear" no longer moves a block down past floats outside its parent div - that's not an IE bug, that's in the spec - then you'll be able to use CSS with arbitrary content. Until then, any Web application that puts user-provided HTML in a template has to use tables to isloate that content.
posted by nicwolff at 7:42 AM on June 23, 2006


I think a better question here is, even with CSS's (or the browser wars) faults, why do people still consistently use it? Because it seperates layout and presentation from content. Pure and simple. And if you're already using css for everything but pure layout...why not go the last mile? It's not THAT hard to get it to work correctly unless you're doing something ultra complicated.

Besides, once you do a couple pages you'll have a good idea what needs to be done and dare I say it you'll have your own templates that you can reuse! Infact, you could even "cheat" and use something like this.

I'd argue tables are more much complicated than using css, for someone that is starting from scratch. However, if you're used to using tables of course you're not going to "like" css as much because it's not what you're used to. I don't want to sound rude or crass to anyone...but if you think css is so complicated I think you better look in the mirror at your table layouts. No one likes the pot calling the kettle black.
posted by crypticgeek at 8:00 AM on June 23, 2006


For a personal site, use tables or CSS. For a paid site, use CSS - it may not be you who'll be doing updates or modifications to the code, so you should use CSS to work on the layout/presentation and leave tables to tabular data.
posted by Meagan at 8:10 AM on June 23, 2006


I use CSS for formatting, so I'm not afraid of it, but I get great, easy, re-usable results using tables.

You can get great, easy, re-usable results using CSS as well. Layout Gala has a collection of 40 CSS layouts that are valid and cross-browser compatible. They even work with IE7. Oh, and they are free to download.

And here's a good overview of the benefits of CSS layouts.
posted by geeky at 8:48 AM on June 23, 2006 [1 favorite]


I haven't used a table for layout since the year 2000, and in those six-and-a-half years I've made plenty of sites that are plenty complicated, and still managed to get them to work in IE5.5+ and all the modern browsers. They're faster to build, easier and faster to redesign and reuse the code, and they're accesible They also work nicely on cellphones.

CSS requires so much hacking to ensure compatibility across browsers
Bull! I ghettoize my IE hacks in a separate .css file, after all the other site work is done, and even on a big site it's rarely more than 25 lines of code.

If you're doing this for your job: tighten up yer panties and learn your tools.
posted by mimi at 9:42 AM on June 23, 2006


Seriously, what is the point of this question? The only person who your choice could possibly inconvenience is you. Find something else to feel bad about.

And the folks who have accessibility issues, both physical and intentional, as mentioned above.

The other thing is that CSS-based design tends to be significantly smaller in terms of bandwidth, so if it's your personal site (especially!) then it might be a good idea.

It's not snobbery - I consider good valid coding to be essential to make the web considerably more like what was originally envisioned than what's available now.
posted by hoborg at 9:56 AM on June 23, 2006


I hate having to mess with CSS, and I always use tables. Don't feel bad.
posted by vanoakenfold at 10:49 AM on June 23, 2006


If you're doing web page layout on the side, no big deal. If you're doing this for a living, you owe it to yourself to stay current and learn CSS and its caveats.
posted by catkins at 11:46 AM on June 23, 2006


Do what you are comfortable with. If it's a personal site, and you feel fine with your code, then don't worry about it at all. The CSS purists will eventually move along and complain about the next guys site...

However, if you are a professional developer, you may want to start learning more about CSS and what an incredible tool it really is. Once you really jump in and get the hang of it, you'll never want to go back to tables. And besides, it will make you a better web-developer.
posted by punkrockrat at 3:07 PM on June 23, 2006


Okay, time for some tough love.

Using semantic, valid markup and cross-browser CSS is not impossible. I do it on a daily basis. It requires diligence, attention to detail, and expertise. It's a mark of professionalism, and I agree that if you're taking people's money you need to build things to spec. If you were making a house, it would be to code. If you were making a network stack, it would comply with the RFCs. If you were making a web page... anything goes, as long as it doesn't require you to keep up to date on modern web design technology? Keep up or find a new line of work.

Seriously.

You're trying to come up with a good reason to learn how to use basic technology which has been around for the past 6 years. That should tell you something about how much you like what you do, and the fact that you find learning about new technologies to be a pain in the ass rather than a chance to expand your toolset tells me that you're either not cut out for the job or in need of a serious attitude adjustment.

I'm not trying to be mean or insinuate that you're stupid, mind you; just as I would make for a spectacularly shit doctor, there are plenty of people who would make for crap web designers for reasons which have nothing to do with intelligence or worth. Either reconnect with what you love about web design or start looking for a career in which the opportunity to pick up new skills excites rather than exhausts you.

Finally, CSS hacks are just that: hacks. People who use them will eventually get bit in the ass. Such is the nature of depending on consistent and stable rendering and parsing quirks. The best practice has always been to use conditional comments, because nine times out of ten it's fucking Internet Explorer that decides that adding a margin really should make the goddamn element block-level. CSS hacks are not a good reason to not use CSS; they are a good reason to not use CSS hacks. (And really, the number of fixes to get IE to play nicely are quite small, and can usually be reduced by a bit of foresight and planning.)

For what it's worth, Jamie Zawinski doesn't care for CSS.

He's also completely misinformed about (or deliberately ignorant of) how people actually use CSS. What he means when he says "CSS sucks" is really "I don't know how to use CSS and that frustrates me." He appears to be more than willing to do weird things with tables, but when someone suggests a fairly simple CSS workaround, he brushes it off as "cheating" or "insane." He wants all CSS implementations to be exactly the same, and refuses to acknowledge the merits of the technology until such time as all browsers render identically and all specs are completely logical and consistent. *shrug* He's a programmer, not a web designer. It shows.

Until then, any Web application that puts user-provided HTML in a template has to use tables to isloate that content.

Four words: cross-site scripting attacks. Allowing users to embed raw, unfiltered (or, more likely, poorly filtered) HTML in a web page is just asking for Javascript worms and XSS attacks. Provide them with a rich, intermediary markup language like Textile or Markdown. Or, alternatively, clean up messes and put out caused by user-provided HTML on a regular basis. Your call.
posted by Coda at 10:14 PM on June 23, 2006


Two words: ---- ---. I'm talking about authorized users putting perfectly legal HTML in a content-management system that filters it real well. HTML that should be to float a block element and then clear another under it, without reference to what's outside its containing DIV. A frequent real-world requirement. Can't be done with CSS. Trivial with tables.
posted by nicwolff at 9:55 PM on June 24, 2006


« Older Applications crash when access internet   |   Must I go barefoot? Newer »
This thread is closed to new comments.