Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9

Thread: DIVs

  1. #1
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,657
    Member #
    1234
    Liked
    138 times
    Why are DIVs better than tables (in most cases)?

    And I would have done a search on it, but it's too small for the search engine.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com

  2.  

  3. #2
    Senior Member justlivyalife's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham, UK
    Posts
    2,871
    Member #
    2374
    justlivyalife - The future depends on what we do in the present. (Mahatma Gandhi)
    WDF Resources: WDF Rules
    Non-WDF: JavascriptSource | Dynamic Drive | phpBB | HTML-Kit | Winamp | Download Firefox | Morguefile

  4. #3
    Senior Member Riat_Sila's Avatar
    Join Date
    Oct 2003
    Location
    Berkshire, UK
    Posts
    417
    Member #
    3485
    Well they're better than tables if you use CSS...

  5. #4
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,657
    Member #
    1234
    Liked
    138 times
    Doh! Forgot about wildcards, thanks. Riat, I wass looking for the WHY.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com

  6. #5
    Junior Member
    Join Date
    Oct 2003
    Location
    New York
    Posts
    13
    Member #
    3580
    I wouldnt say that DIV tags are better then TABLE tags. It's like saying an blue is better then red. It really depends on what scenario you are in.

    Tables are great for the layout of your page.

    DIV tags.. I like to think of them as a "blank" tag. You can really do what ever you want with it, and then make a CSS stylesheet that will do whatever you want to do with it. Basically it is almost exactly the sam as the "SPAN" tag.

    The main difference between DIV and SPAN is that the div tag adds a line break, the same way the P tag does.


    ____________________
    ViewTopia Web Hosting
    Coming Soon!
    ViewTopia Web Hosting
    Coming Soon!

  7. #6
    Senior Member nocloset's Avatar
    Join Date
    Sep 2003
    Posts
    108
    Member #
    3228
    The <table> tag was devised for the display of tabular data. (That's why a table cell is <td>, which stands for "table data.") Tables were not meant to be used for page layout.

    It makes a big difference if you want your page to be accessible to the visually impaired. They're going to get your content in order, row by row. When you use tables for page layout, you get a lot of colspans and rowspans, and that makes the order of your content get messed up.

    The <div> and <span> tags were devised for purposes of layout. Together with CSS, they are very powerful and appropriate for the purpose of doing page layout.

  8. #7
    Senior Member nocloset's Avatar
    Join Date
    Sep 2003
    Posts
    108
    Member #
    3228
    Here is a really good article with examples on the subject of using <table> versus <div> for layout.

    http://www.glish.com/css/

    Oh, and one other important point about not using tables for page layout: Using <div> allows you to separate content from presentation. This way you can redesign a web page without mucking with the content. If all of your content is stuck into table cells, then redesign essentially requires you to start over. With <div> tags, you can isolate all of your presentation in the CSS.

    CSS Zen Garden is my favorite site for showing how much can be done with page layout if you don't use tables and instead use <div>s and CSS. Every page on this site has exactly the same HTML code; only the CSS is different.

  9. #8
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,657
    Member #
    1234
    Liked
    138 times
    Great links, thanks! Actually, I wasn't thinking of tables, more that iThing, Can't remember name lol
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com

  10. #9
    Junior Member
    Join Date
    Oct 2003
    Location
    New York
    Posts
    13
    Member #
    3580
    I am taking a look at those sites now. I must say I stand corrected. CSS does appear to be a much better and easier way to layout a page.
    I had always thought that absolute positioning (or css for making a layout) was evil. That could be because I learned around the time that IE4 came out, or because I learned from someone who just didn't like css. Either way, I can clearly tell what i will be using to design sites for now on!
    ViewTopia Web Hosting
    Coming Soon!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:13 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com