What to use Tables or DIV's ?

Last post 08-17-2005 7:20 PM by Elegabalus. 6 replies.

Sort Posts:

  • What to use Tables or DIV's ?

    08-12-2005, 7:01 AM
    • Member
      5 point Member
    • Stonne
    • Member since 08-12-2005, 10:55 AM
    • Antwerp -Belgium
    • Posts 1
    Hello there,
    When creating a master page should I use a table or use DIV's in html ?
    What's best ? Should I include a CSS ? and... if possible... why and when
    I want to start the right way !
    thanks already
    Best regs Stonne
  • Re: What to use Tables or DIV's ?

    08-12-2005, 8:47 AM
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815
    "What's best ?"

    Uggg, that's a TOTALLY subjective question, i'd suggest you read up on DIV-"Table-less" design (http://www.google.com/search?hl=en&q=css+table+design) and make the call on your own.....

    as for "should i include CSS", if you are doing tables or divs, its "cleaner" to pull the styles out of the code and into the file just so its easier to change across the site....
    "If you make it idiot proof, they'll build a better idiot"
  • Re: What to use Tables or DIV's ?

    08-16-2005, 12:44 AM
    • Member
      645 point Member
    • Meson
    • Member since 07-09-2005, 10:15 AM
    • Posts 127
    As a general rule:

    tables for tabular data. Divs for everything else.

    These are W3C rules / recogmendations. Take them as that.

    If you need tables for "layout", use divs with css.

    As for the separate CSS file? There are hints that the W3C is thinking of making it a requirement. It splits the format and the structure.
  • a good url

    08-16-2005, 9:26 AM
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815
    talking about this vs that

    http://www.decloak.com/Dev/CSSTables/CSS_Tables_02.aspx

    (even though this guy is obviously anti-CSS, he does make very valid points)
    "If you make it idiot proof, they'll build a better idiot"
  • Re: a good url

    08-16-2005, 3:51 PM
    • Member
      70 point Member
    • Webdev511
    • Member since 07-01-2005, 6:37 AM
    • San Jose, CA
    • Posts 14

    Wow, that guy REALLY hates CSS-P.

    I think there his a middle ground between him being a hater, and what he sees as CSS purists. He dismisses accessablility far too freely. If he haver actually had to use one, I think he'd change his tune.

    I personally belive that it's easier to create a page for print and screen without layout tables. If you have any information on your site that is likely to be printed, and you don't feel like creating a seperate page for print, having a css file per media type is far easier than making two pages.

    A well tought out XHTML page that uses CSS layout & display is also far more friendly to mobile browsers. MS thinks its important enough to provide a tool kit for it.

    Fact is that a majority of the know how and comon thinking requires tables. It's a natural result stemming from too many years of Netscape 4 support.

    My personal opinion is yes, at least TRY to use CSS. If you come accross someone hitting your site with an older browser, tactfully inform them that thier browser choice may expose them to certian security risks. You do them a service by helping them stay secure and yourself a favor by promoting more standards compliant browsers.

    Garth H
    San Jose, CA
    Microsoft Certified Professional
    Macromedia Certified Developer
    http://www.511th.com/
  • Re: a good url

    08-17-2005, 4:34 AM
    • All-Star
      17,179 point All-Star
    • Dave Sussman
    • Member since 06-17-2002, 11:53 AM
    • UK
    • Posts 2,368
    • ASPInsiders
      TrustedFriends-MVPs
    The real problem with CSS for layout is forms- the standard data entry type stuff. You can do it with CSS, but it's not very elegant. The world needs a better way to do it.

    Dave
  • Re: a good url

    08-17-2005, 7:20 PM
    • Member
      315 point Member
    • Elegabalus
    • Member since 12-03-2004, 8:07 PM
    • Posts 63
    For me, CSS is the preferred way of styling pages (in terms of color of backgrounds, font sizes, etc.).

    In terms of laying out a page, pure CSS still has severe problems.  I've spent many an hour trying to work with CSS to get a pretty standard layout scheme (header, footer, 3 columns in the middle).  This is trivial using table layouts, but requires some very intricate work in CSS.  Granted, most of the work comes from Internet Explorer's poor CSS support, but try justifying dropping IE support to your boss, and see how that goes. :-)

    I've found that master pages are the perfect way to get the best of both worlds.  Set up your table structure in the master pages, and use "proper" layout techniques in the content pages.  Since you mostly work in the content pages, you don't have to wade through a bunch of nested tables to make a small change to the HTML in the content page.
    Overall, I'd say it's a good idea to get quite familiar with using CSS, but as in most things in life, take the people on the extremes of the argument (pure CSS versus advocates versus people that use 40 nested tables to display an image) with a large grain of salt.

Page 1 of 1 (7 items)