0

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?

21
Contributors
35
Replies
39
Views
13 Years
Discussion Span
Last Post by justcrowd2010
Featured Replies
  • you [I]can[/I] use a motorcyle to deliver a houseload of bricks, two or three at a time, a truck delivers the bricks, they arrive less damaged, faster, and use less fuel to do it. can <> should possible <> best <table>s and <div>s have their strengths, it is difficult to … Read More

  • 1
    diafol 3,708   7 Years Ago

    Hmm. I always try to stay clear of inline styles and presentational [I]classitis[/I]: [CODE]<div id="my_id"> ... </div> <br />[/CODE] and [CODE]#my_id + br{ clear:both; } [/CODE] Would be my take if the previous tag (container) had an id. Perhaps that's being a bit anal, but I try to hide all … Read More

0

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 say divs :)

0

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

0

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!!!!

0

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.

0

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

0

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

0

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

0

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 <div id="nav">...</div>, when often all you need is something like a <ul id="nav">...</ul>. THat's just my opinion though.

0

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!

Edited by MJ Pieterse: n/a

0

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

0

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 <div id="nav">...</div>, when often all you need is something like a <ul id="nav">...</ul>. THat's just my opinion though.

0

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!

0

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.

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.

0

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.

0

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.

-1

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

Thanks

virtual base

0

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.

I was taught (and what I do) is the "proper" way of doing things, according to the W3C, at least, is to use divs for layout and tables for tabular data. However, if that's what one is supposed to do, then how come a div can have its display CSS attribute set to 'table cell' if it's not meant for tabular data?

2

you can use a motorcyle to deliver a houseload of bricks, two or three at a time,
a truck delivers the bricks, they arrive less damaged, faster, and use less fuel to do it.

can <> should
possible <> best
<table>s and <div>s have their strengths, it is difficult to have sortable divs, POC to have sortable tables

Edited by almostbob: n/a

-2

Hi,

Valuable tips are shared here.This will help the web designing beginners.
One of the good advantage of DIVS is that they are secure to use. They responses quickly. Thanks for sharing this post.

Thanks.

Votes + Comments
divs are secure ? What ?
0

I have to admit I did "cheat" once and use a table to align items instead of floating divs because Internet Explorer hates float. While tables do work... I still think its more of the "idiot" method because it means people can just use tables with html and not even touch css. Tables are for people who know nothing about web development.

-1

old stuff. better dont bump it ,,... div is now used by most web developer and all of smart web developer :)

0

I have to admit I did "cheat" once and use a table to align items instead of floating divs because Internet Explorer hates float. While tables do work... I still think its more of the "idiot" method because it means people can just use tables with html and not even touch css. Tables are for people who know nothing about web development.

that was exactly the same problem i've faced when i used div for the first time. but then i've got a solution by using clearing element (<br class="clearing" /> which has a clear: both) until now.

0

clear is your friend :)

I use <div style="clear:both"></div> a LOT.

Edited by Dani: n/a

0

clear is your friend :)

I use <div style="clear:both"></div> a LOT.

<br class="clearing" /> is simpler anyway :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.