1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

<DIV> vs <TABLE>

Discussion in 'HTML & Website Design' started by latehorn, Jan 6, 2006.

?

What's your opinion

  1. I use only <DIV>

    38 vote(s)
    33.9%
  2. I use only <TABLE>

    20 vote(s)
    17.9%
  3. I use a mix between aka sementism

    54 vote(s)
    48.2%
  1. missdanni

    missdanni Guest

    Best Answers:
    0
    #101
    I use both, they each serve a different purpose.
     
    missdanni, Jan 22, 2006 IP
  2. wallaceuk

    wallaceuk Peon

    Messages:
    15
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #102
    I've been in involved in the div V tables debate a few times and it's mostly each to their own. Some people code in tables because it's quicker for them, others code using css because their more experienced at it etc etc. Long term, div's are a better bet but it's the end result that really counts.

    In my eyes it really isn't the code which is important as so much the finished article, customers buying CD's through ebay didn't notice the missing doctype or the 187 validation errors the homepage throws up, but it's one of the most successful sites out there.

    If it can be coded neatly and it validates it's a bonus, but if it doesn't and it sells bucketloads, then either way it's fulfilling it's purpose.
     
    wallaceuk, Jan 23, 2006 IP
    Dio likes this.
  3. advanet

    advanet Peon

    Messages:
    77
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #103
    Sometimes I find divs rather confusing.
     
    advanet, Jan 23, 2006 IP
  4. irka

    irka Well-Known Member

    Messages:
    1,875
    Likes Received:
    183
    Best Answers:
    0
    Trophy Points:
    185
    #104
    I say i would use DIV for the layout and Table for content organization such as the newspaper in your leftframe navigation pannel.

    Anyway they are completing each other, there is no bad or good things between those 2 way of designing.
    I use both :p
    BUT i tend to use more the <div id="wazupp">true</div>
     
    irka, Jan 24, 2006 IP
  5. wasabi

    wasabi Guest

    Messages:
    58
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #105
    Div are specifically used to build your website. Tables are only used to show datas, for better visibility.
    Plus, div make the source code less heavy.
     
    wasabi, Jan 24, 2006 IP
  6. anions

    anions Notable Member

    Messages:
    4,840
    Likes Received:
    179
    Best Answers:
    0
    Trophy Points:
    275
    #106
    I mostly use only <div> too:)
     
    anions, Jul 5, 2007 IP
  7. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #107
    Both have their uses and should be used appropriately.

    The issue is that we have gone from one extreme to another where people are now using divs in the same inappropriate uses as tables were once commonly used.

    Have shown a few designers the impact of their divs when their site is used with programs for people with visual impairments.
     
    AstarothSolutions, Jul 5, 2007 IP
  8. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #108
    Ah Christ, the old debate AGAIN.

    My theory is this:

    There are only FIVE good reasons to use a table instead of DIV's

    1) You MUST have your columns reach full height because faux-column techniques won't cut it or end up too big code-wise.

    2) You MUST have vertical positioning middle or bottom of dynamic height content.

    3) You need to use floats inside your columns in a way that is messing up your layout.

    4) Your layout is so complex that using DIV's ends up two or three times as much code as a table (which I've seen people do)

    5) It's a table of data - aka like an excel spreadsheet

    That's it. Vary from those, /FAIL/ at life.

    Part of the problem is the overuse of tables, AND the overuse of DIV. Too often you see people doing REALLY stupid stuff like using a table around one cell - or a table for a column of cells with no heights declared all aligned top.... or table in a table in a table for just three or four actual 'elements'.

    ... and when you get those people onto the anti-table mafia bandwagon what do they spit out for code?

    <div class="center top clear"><span class="header"><p>Sometext</p></span></div>

    and if you don't know what's wrong with that, do the world a favor, back away from the keyboard and go make a macrame hammock. Classnames should say what something is, not how it appears, there is no need for the extra SPAN, SPAN is a inline element you cannot put block levels like P inside them... and the whole malfing thing should probably just be a H2 tag.

    <h2>Sometext</h2>

    I swear, some of the code people vomit up. I see one more:

    <div class="menu">
    <ul>
    <li>menu item 1</li>
    <li>menu item 2</li>
    </ul>
    </div>

    Where the only thing the outer div is not used to apply any styling that couldn't be applied directly to the UL, I'm gonna backhand somebody.

    Thing is, the anti-table mafia IS full of **** most of the time as many of their excuses - render time (oh yeah, adding 3k of CSS really makes that page load faster. If a 386 running Win 3.1 can render a table, I'm NOT worried about render time), clarity of code (It's called the tab key, USE IT), overuse of inline styling (so use classes JUST like you would for DIV's), Cannot do SEO (put a empty TD at the start, make your next two rowspan="2", put the first column last) - All bullshit claims. The only arguement that holds ANY weight is the ability to rearrange the columns regardless of source order - something that shouldn't be an issue if you bother to learn how to use SSI's in the first bloody place.

    You can make clean reasonably semantic layouts in tables just as easily as you can DIV - in a number of ways they are simpler, but again lack the ability to rearrange the columns JUST from the CSS.

    Bottom line, DIV layouts and TABLE layouts are just tools - use the one that is simplest and least code for the task at hand. There's a lot of bullshit advice out there, and the trick is to glean the facts from the snake oil.
     
    deathshadow, Jul 5, 2007 IP
  9. dylanbathurst

    dylanbathurst Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #109
    Using divs for structure and tables for tabular data is most sensible to me. Using a table for structure just seems like a lazy way to get something just thrown up on a site.
     
    dylanbathurst, Jul 5, 2007 IP
  10. bacanze

    bacanze Peon

    Messages:
    2,419
    Likes Received:
    127
    Best Answers:
    0
    Trophy Points:
    0
    #110
    Why has this thread been bumped? its over a year old ?!
     
    bacanze, Jul 5, 2007 IP
  11. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #111
    Some discussions never die - still see CD -v- vinyl debates on music forums.

    I am just impressed someone actually searched for the topic rather than posting a new thread
     
    AstarothSolutions, Jul 6, 2007 IP
  12. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #112
    Which is probably why it was done - because believe me if someone had started a new topic about this, you'd get some jackass linking to this topic and saying "Use the search stupid"... just as you get the people complaining about the bump.

    It's REALLY annoying on forums as thanks to long term members at most sites you end up damned if you do, damned if you don't because SOMEBODY will complain either way.
     
    deathshadow, Jul 6, 2007 IP
  13. nishugoyal

    nishugoyal Peon

    Messages:
    63
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #113
    It is very simple:

    If you have to repeat same layout at many places use CSS
    else if you have to write a small localized which you are never gonna modify use tables..

    css is more like object oriented
     
    nishugoyal, Feb 9, 2008 IP
  14. Riboflavin

    Riboflavin Well-Known Member

    Messages:
    1,091
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    155
    #114
    Thank you for bringing up this 6 month old thread...
     
    Riboflavin, Feb 9, 2008 IP
  15. Morishani

    Morishani Peon

    Messages:
    239
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #115
    Well I never use table to layout my sites,
    But I try not to use DIV too - instead I use more semantic tags like H1..H6, UL, OL, Em, Strong, Etc'.
     
    Morishani, Feb 9, 2008 IP
  16. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #116
    let it die!
     
    soulscratch, Feb 9, 2008 IP
  17. mds

    mds Active Member

    Messages:
    256
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #117
    I think both <div> and <table> can be used in unique ways . Personally i use both all the time or either depending on what iam designing.
     
    mds, Feb 9, 2008 IP
  18. jms.heath

    jms.heath Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #118
    In situations like this, I think it is important to remember the reaon for which tables were created in HTML. They were created for the organization of figurative data. DIVS are and always will be the only building blocks in terms of web design for me. :)
     
    jms.heath, Feb 9, 2008 IP
  19. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #119
    point made. let this die.
     
    soulscratch, Feb 9, 2008 IP
  20. forumAdict

    forumAdict Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #120
    dont discriminate use both together ;-) :cool:
    <table>
    <tr>
    <td class="class_name1">
    <div class="class_name1">
    </td>
    </tr>
    <tr>
    <td class="class_name2">
    <div class="class_name2">
    </td>
    </tr>
    </table>



    :eek:
     
    forumAdict, Aug 1, 2009 IP