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.

CSS: DIVs vs Tables

Discussion in 'CSS' started by olddocks, Oct 29, 2007.

  1. #1
    why use divs when you can design sites with tables?
    :confused:
    Besides this, I am having nightmares with css div and it looks like causing lot of browser incompatibility problems. Sometimes works in IE not in Firefox.

    is there any reason that i must be convinced to use <div> (without tables). Am i missing something here? :confused:
     
    olddocks, Oct 29, 2007 IP
  2. albemarle24

    albemarle24 Well-Known Member

    Messages:
    244
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    138
    #2
    Because Google says so. :( or at least their ranks indicate thats what they want . :cool:
     
    albemarle24, Oct 29, 2007 IP
  3. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #3
    Google actually doesn't care. And I believe the majority of sites are still coded in tables. The main reason to use CSS is to seperate content from presentation and behavior, so you don't have to worry about presentational effects when you are editing the content.. because you should mark it up with semantics. CSS makes site maintenance a breeze.. when you have a site that has 30000 or so pages, and you want to increase your page to something higher, you won't have to edit the width value on 30000 pages.. just one value in the external stylesheet. This is just the tip of the surface..

    I suggest you read this below
    http://forums.digitalpoint.com/showthread.php?t=413544
     
    soulscratch, Oct 29, 2007 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    As soulscratch said, Google doesn't give a fig one way or another.

    Tables have their use - primarily for the display of data tables. If you know what you're doing, you can use them for layout, but except for rare (and by rare I mean those "less than 1%" situations), I wouldn't do it.
     
    Dan Schulz, Oct 29, 2007 IP
  5. albemarle24

    albemarle24 Well-Known Member

    Messages:
    244
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    138
    #5

    Several threads here and on other forums discuss tables vs. divs in terms of SEO, with opinions on both sides. I happen to agree that div designed pages tend to outrank otherwise comparable table designed pages.
     
    albemarle24, Oct 30, 2007 IP
  6. Divisive Cottonwood

    Divisive Cottonwood Peon

    Messages:
    1,674
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I can't imagine that for SEO there is any difference between divs and tables.

    Tables are a good way to start learning webdesign. It's best then to start to add certain basic features such as the following code:

    body {
      background-color: #000000;
      color: #FFFFFF;
      font-family: "Times New Roman", Times, serif;
      font-size: medium;
    }
    
    a {
      color: #FFFF00;
    }
    
    a:visited {
      color: #0000FF;
    }
    
    a:hover {
      color: #00FFFF;
    }
    Code (markup):
    This is pretty basic as CSS gets - background colour of page, font, size of font and it specifies the colour of links.

    From that you can start playing around with other aspects of presentation and then layout.
     
    Divisive Cottonwood, Oct 30, 2007 IP
  7. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #7
    I would take Dan's/Deathshadow's word over anyone's in this whole forum about this topic. And, for the statement in bold I suggest you get googling and view-sourcing, because the number of sites that use tables for layout is greater than the number of sites that use CSS for layout.
     
    soulscratch, Oct 30, 2007 IP
  8. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You obviously didn't read the thread I started which soulscratch was kind enough to link you to.

    Anyway, this thread has NOTHING to do about SEO since this happens to be in the CSS thread. And for the record, when used properly, there is no such thing as a "DIV designed" page - it's just the proper HTML elements used for the job (to define the structure of a Web page) styled properly with CSS.
     
    Dan Schulz, Oct 30, 2007 IP
  9. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Google bots just read whatever text they find, and they click on whatever links they find. They don't care what it sitting in. Who cares? Browsers care.

    1. If the whole site is built in one huge table, nothing will show on the page while it's loading because a browser renders a table when it has everything first. (So the smarter table-builders use seperate tables for things like header, sidebars, etc.)

    2. If you just build some crappy table with seemingly random tds and trs wandering around, it's hell for someone with a screen reader (read: blind dudes who likely want to buy your products online) who can't make heads or tails of it. This can be avoided with semantic div-based markup, or well-built, well-thought out tables.

    If a div-based site gets better SEO, it's not because of the divs. They marketed themselves better, or have something people want like porn, or were smart in setting as much relevance throughout their site as possible.
     
    Stomme poes, Oct 30, 2007 IP
  10. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #10
    Unless you set table-layout:fixed; - and technically it doesn't show until the HTML is fully loaded. Keep your HTML to a REASONABLE size (<16k) and this isn't even an issue.

    It's funny, in a number of ways I PREFER a site not to show it's content until the HTML and CSS have finished loading - that way you don't have that stupid 'jumping' into position crap.

    Uhm, not quite. a separate table just for a header is #DDD - but you see it all the time.

    The problem is usually NOT tables, but overuse of tables... and the people who wrote the bloated crap table around every tag usually end up writing bloated DIV's and SPAN's around every tag - which is NO improvement at all.

    In other words content.
     
    deathshadow, Oct 31, 2007 IP