Page 1 of 4 1234 LastLast
Results 1 to 10 of 32

Thread: What is better to use "div" or "tables"?

  1. #1
    Hi all,
    I would like to know some doubts that I have. I have observer that some websites are using "div" and other "tables".
    What is the difference between those 2? What do I get or what results, if I use "div" or "tables" in my website.
    I would like to hear some professional opinions.
    Thanks a lot to all,

  2. Internet, Programming and Graphics   -   #2
    tesco's Avatar woowoo
    Join Date
    Aug 2003
    Location
    Canadia
    Posts
    21,669
    Depends on what you are trying to do.
    Tables are good for, well, tables (of data). For example this was a perfect candidate for a table: https://filesharingtalk.com/what-trackers-offer/

    A "div" is just a container element, like "span", the difference between the two being that div is a block element and span is an inline element. They can each be changed to the opposite by using display: block; or display: inline-block; in your CSS.

    For creating a site layout of header, columns, data in the middle, and a footer, the proper method would be to use div, span, etc. combined with CSS to get your layout.
    Though tables are a much easier method for newbies, because you don't need to learn CSS or do any calculating or tinkering, it just works, at the expense of bloated and convoluted code.

  3. Internet, Programming and Graphics   -   #3
    sandman_1's Avatar Poster
    Join Date
    Aug 2010
    Location
    Somewhere
    Posts
    519
    LOL when I read the header, I thought ohh an assembler question, great!

  4. Internet, Programming and Graphics   -   #4
    As for me, I'm pretty surprised the first two posters haven't appended a fake signature to their messages, or have ad links on their profile page.
    "I just remembered something that happened a long time ago."

  5. Internet, Programming and Graphics   -   #5
    GreenTea's Avatar 99.9% SHY BT Rep: +2
    Join Date
    Feb 2007
    Location
    under your bed
    Posts
    106
    div is divinitely better for layouts. and tables, for tabular data.

  6. Internet, Programming and Graphics   -   #6
    janovein
    Guest
    Use the <table> element to create complex page designs, often using graphics to create looks that could not be done with the very limited HTML of the day ( no CSS, barely any formatting possibilities ). Unfortunately, the 'table' element was never really meant to fulfill this duty, but was supposed to contain data, like from a database.
    Nevertheless, the web steamed on using primarily tables to construct all web pages, much to the chagrin of the W3C, the World Wide Web standars body. They quickly realized that the design of the page had to be taken into account, and so began to try to undo the damage that had been done already. The solution?—CSS 1 ( Cascading Style Sheets ), and some new HTML tags, <div> being most important. Div, when styled with CSS, was developed to allow designers unprecedented control of the layout of a webpage.

  7. Internet, Programming and Graphics   -   #7
    jalicia18
    Guest
    I prefer div for my web layout.. to get fast indexed in SE.

  8. Internet, Programming and Graphics   -   #8
    Div + CSS > Table. It's way more flexible.

  9. Internet, Programming and Graphics   -   #9
    bijoy's Avatar secret lover BT Rep: +1
    Join Date
    Aug 2010
    Posts
    1,820
    Quote Originally Posted by mr-mr View Post
    Div + CSS > Table. It's way more flexible.
    I smily answer:
    Teh n00b.

  10. Internet, Programming and Graphics   -   #10
    The tableless layout is much more flexible and customizable.
    Plus, its more easy to code your design, to arrange the slices of your PSD.
    Moreover, the HTML code is more simplified and neat when using divs than using tables.

    If you learn more about CSS and HTML coding and try to make some web layouts, you will answer your question by yourself.
    Last edited by Daydream; 02-06-2011 at 03:47 PM.

Page 1 of 4 1234 LastLast

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
  •