954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

web design: tables versus divs

A lot of web developers are strongly opinionated that divs should be used for design and tables for tabular data, but I am still not entirely convinced that website designers should jump on it yet. I haved designed web sites using both, and in my experience I have found that carefully using tables produces more cross browser compatible designs than using divs carefully. Does anybody have any strong evidence or convictions on either side of the fence for this argument?

Arizona Web
Junior Poster
118 posts since Jun 2004
Reputation Points: 16
Solved Threads: 2
 

With divs, people can't steal your images if you use

style="background-image:url('/temp/img.jpg');"

unless they really want to

In my (about 5) websites, I find that divs load faster, but that's probably just my head. Tables for layouts are frowed upon by the most hard core "standards" people. I dunno, I started learning HTML with XHTML 1.0 Strict, and now I use 1.1, so I guess you could say I never did dabble in table layouts. Anyways... nuff babbling, I saydivs :)

Innocent
Newbie Poster
5 posts since Jul 2004
Reputation Points: 10
Solved Threads: 1
 

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
Administrator
19,436 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 

im a tables man myself, i feel i can design just as good with them as i can with div's, but i dont do div's that much so i dunno. i think ill give div's a go and make a better educated desicion later. OFF TO CODE SOME MORE!!!!

Killer_Typo
Master Poster
781 posts since Apr 2004
Reputation Points: 152
Solved Threads: 39
 

Thank you for posting this topic. I am curious as well. I have always used tables and grew very fond of them as I can do just about anything I want with them and their contents. Though, since I have been studying a bit about CSS the past few days I'm seeing a wider versatility with the CSS, and possibly divs. Though, as yet, I haven't tried using either one. So, I'm still on the fence about things.

Kaycy
Light Poster
29 posts since Apr 2010
Reputation Points: 10
Solved Threads: 1
 

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
 

Thank you. That helped even better to understand the usage of tables/css. :)

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
Kaycy
Light Poster
29 posts since Apr 2010
Reputation Points: 10
Solved Threads: 1
 

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)
Moderator
7,795 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

YEAH DIVS!!!! they are the best thing since sliced bread! the only time i use tables is when i'm busy with a client reporting project (once again, that is only for the stats, but the whole site is basically divs). Divs give you that extra that you don't get from tables. Besides that, crawlers finds it easier to read div tags than tables (or so i read).

To find the edge, use divs!

MJ Pieterse
Junior Poster
145 posts since Mar 2009
Reputation Points: 13
Solved Threads: 18
 

Thank you Laura for your input. I've seen divs and tables. Though I am used to tables, since 1999, and I am going to be trying my hand at the divs and css side of things.

I do use dreamweaver but am in code mode all the time so I keep an eye on the coding. The main reason I use it is for the ease of the visual parts when I haven't uploaded it to the sites yet. I also learn from using it as well. How to code other things such as form items.

I am believing everyone about the newest way to do things with coding using the divs and css. Now I just need to learn how to implement them into web pages. :) Learning one step at a time. :)

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).

Kaycy
Light Poster
29 posts since Apr 2010
Reputation Points: 10
Solved Threads: 1
 

That's an interesting idea, Ardav. hmmm

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.
Kaycy
Light Poster
29 posts since Apr 2010
Reputation Points: 10
Solved Threads: 1
 

LOL that is my feelings about tables!

But, I am here to learn more than just tables, and it's alternatives, and basic HTML.

So, all ideas and experiences are more than welcome to come across my screen. I do read ALL of them and check out ALL links posted.

YEAH DIVS!!!! they are the best thing since sliced bread! the only time i use tables is when i'm busy with a client reporting project (once again, that is only for the stats, but the whole site is basically divs). Divs give you that extra that you don't get from tables. Besides that, crawlers finds it easier to read div tags than tables (or so i read).

To find the edge, use divs!

Kaycy
Light Poster
29 posts since Apr 2010
Reputation Points: 10
Solved Threads: 1
 

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)
Moderator
7,795 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

Gr8 information from all of you its my dr8ful thanx

Rider99
Newbie Poster
10 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

Ok, you may shoot me now then. LOL

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.
Kaycy
Light Poster
29 posts since Apr 2010
Reputation Points: 10
Solved Threads: 1
 

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
 

Divs for laying out page elements, tables for data and form element positioning.

Veneficae
Light Poster
38 posts since May 2010
Reputation Points: 11
Solved Threads: 5
 

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
 

yes the main advantage is that div loads quickly but i agree tables are better then div.

Thanks

virtual base

webdeveloperr
Newbie Poster
1 post since May 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You