Mark IJbema's Blog

Entries for Tuesday 09 November 2004

Tables better than css?

9th November 2004, just after midnight | 310 comments

I wonder if somebody can explain me why divs + CSS is better for layout than tables. I really wonder about this, sure i like CSS, but lets say you want a two column layout. You can do this with two divs, and float one left, or something like that. Instead you could do it with a table with two cells.

Lets compare those two in various situations:

  • Browser renders tables and css
    • Div version: looks good
    • Table version: looks good
  • Browser renders no tables and no css
    • Div version: you get both parts after each other
    • Table version: you get both parts after each other
  • Browser renders tables but no css
    • Div version: you get both parts after each other
    • Table version: you still get a nice two-column layout

So i don't really see why css is better for simple layouts like this one. This occured to me when i saw yahoo mail in a text browser. It still looks like how the site is rendered in a graphical browser (at least it did then, yahoo recently switched to css, so i don't know how it looks now).

So anyone, why should i prefer divs over tables here?