SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: div vs tables

  1. #1
    SitePoint Addict
    Join Date
    Sep 2002
    Posts
    225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    div vs tables

    I'm sure this has probably been discussed before on this site, but I can not for the life of me find it anywhere. Therefore, I thought I would just post this message anyway in hopes that someone can point me in the right direction or just start a new discussion.

    I'm just curious to know what are the pros and cons of designing a site entirely using the div tag vs using the table tag? What are your limitations of both? Who would you be excluding using the div tag? What situations would you want to use the div tag over the table and visa versa?

    I'm kind of new at this and just looking for some answers so I can know which way I need to design future sites in.

    Thanks!

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2003
    Location
    behind my computer
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Divs load faster than tables and tend to be more flexible than tables. They also integrate much more easily with PDAs and such and can achieve much better print results than tabular layouts. Table design tends to be a tiny bit more straightforward for those used to it, although the learning curve (with help from us here of course) for using css and table-less design isnt all too undaunting. In fact its kind of easy, and once youve come to the light side, you wont ever go back.

    Use tables for aranging tabular data.
    Use divs for layout setups.

    Go with divs.

  3. #3
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Corner seat
    Posts
    1,069
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use tables for arranging tabular data.
    Use divs for layout setups.

    Go with divs.
    I'm actually having a similar problem. If it's not too inconvenient, can you give me some examples for "arranging tabular data" and "layout setups"? Also should div tag be used instead of table/tr/td to make the site w3c compliant? Sorry if it's such a trivial question or if I'm asking the question without understanding w3c standard. Making the site w3c compliant and making it truly accessible and usable on all platforms is actually kind of new to me.

  4. #4
    SitePoint Enthusiast Gamblingharry's Avatar
    Join Date
    Apr 2003
    Location
    UK
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Take a look at this page, here. The table of info in the middle is data that belongs in a table i.e. its a table that has labels for rows and columns etc.

    The layout of the page however is done with divs. They set out the layout of the page. I could have made a big table to put everything in the page in - but the page isnt tabular data. Feel free to look at the div and CSS setup.

    Not sure about complying with W3C etc....

  5. #5
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Here are some previous discussions on the matter. This is just from the last couple of weeks or so:

    http://sitepointforums.com/showthrea...ght=css+tables
    http://sitepointforums.com/showthrea...ght=css+tables

  6. #6
    SitePoint Enthusiast
    Join Date
    Jun 2003
    Location
    behind my computer
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    W3C Compliance just requires tables to not be used for layout purpouses...so use divs
    Try and look at vgarcias page, who i decided to use because hes got a print layout....
    http://www.vinniegarcia.com/
    In mozilla, along the bottom left hand corner of the screeen, select basic layout (which happens to be the print layout) and you can see his page in black and white...
    Thinkgs look fine with or without his layout to back it up...maybe not as pretty, but everything still works...

    Even if you dont have the alternate stylesheet setup, you can still benefit from search engine ranking you correctly, text will grow accordingly, everything will work better.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •