I also agree that divs load faster. People can steal your images either way ;) Table people can use table background="/temp/img.jpg" - In any case, I still say divs. The DaniWeb header, footer, and nearly all of the homepage are all div tags. Anyone find it not cross-browser compatible? Personally I feel that I can do more nifty things with div/css than I could do with tables to make it MORE cross-browser compatible ;)
cscgal
The Queen of DaniWeb
19,436 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
tables for tabular data,
luv javascript tablesort routines view data any which way
but I use css to style the table,
and use tables for tables not for layout of anything else
almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
I'm all for divs. Tables should only be used for tabular data (as has been said many times above). I find divs A LOT more flexible that tables, and also a lot easier to look at in the code side of things.
I work for a place that creates and maintains about 100 or so sites, and when I have to make any structural changes to the older (tabled) sites, its a nightmare. Half the time I can't see when something begins and when it ends. I don't think it helps either that many of them were created in Dreamweaver (shutters).
laura_ci
Junior Poster in Training
73 posts since Jun 2009
Reputation Points: 10
Solved Threads: 5
DIVs are OK in theory, but I think they can be overdone. Hundreds of nested divs (or divitis), to me is almost as bad as using tables. I like to see sensible markup that isn't linked to presentation. Very often divs are used unnecessarily, e.g. for navigation, you'll sometimes see a ..., when often all you need is something like a .... THat's just my opinion though.
diafol
Rhod Gilbert Fan (ardav)
7,795 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
Just so I'm not misunderstood - divs ARE the way to go IF they are needed. Tables should definitely NOT be used for layout. IMO, anyone still using tables for general layout should be shot.
diafol
Rhod Gilbert Fan (ardav)
7,795 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
check out w3c and go through a couple tutorials if you're getting started with div/css.
It won't take much time and overall div are much better than tables. Imagine if your site is 1000 pages, trying to change individual table elements would drive you crazy. Of course there's lots of other reasons to use div but don't overdo it and make everything div.
newviewit.com
Junior Poster in Training
88 posts since Sep 2009
Reputation Points: 12
Solved Threads: 1
My advice is to use divs for layout, unless they refuse to work. One place they refuse to work is when a table is inside a div.
One trick to making a div behave is to set its display attribute to "table cell." Then it keeps other objects from intruding on its borders.
Always use tables for tabular data.
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182