Div tags VS table tags

Posted on 2006-05-04
Last Modified: 2013-11-19
Hello all.   I would like to know what some experts on EE think about using the Div tag.  Does it affect performance VS using straight table tags.  Are there any real disadvantages using them at all?  I have not seen any disadvantages but I would be curious to see others response.  Thanks all
Question by:sbornstein2
    LVL 2

    Accepted Solution

    I'm quite familiar with the ease of using tables in page layout as I've used this technique before However, one of the main reasons why I switched to divs is not because of the design possibilities that come with it, but because it's the right tag (semantilcally) to use when defining the structure of your html document. Tables were meant to be used with tabular data like this:

    <table summary="Pets and their owners">
         <th>Pet Name</th>

    whereas div is used to organize elements into meaningful chunks like this:

     <div id="navigation"> ...some elements.. </div>
     <div id="maincontent">
        <p>This is the main content</p>
     <div id="footer">

    Overall: Tables makes things easy, but divs are the way to go.... Don't see other disadvantages apart from the structure ...
    LVL 15

    Assisted Solution

    Chokehold hit the basics on the head, so I'll just add a few less prominent (and, in most cases, relatively minor) notes...

    Some browsers may take longer to render if many tables (especially tables-in-tables) are used, as the number of rendering objects (tables, rows, cells, tables, etc.) is greater.  The only browser I recall having a serious problem along these lines was Netscape 4.x (which could be sent into a serious tailspin while trying to load a page containing too many concentric tables), which is thankfully an uncommon browser these days (and later versions of Netscape don't have this problem so much), so this is likely a minor effect in all but the most table-berserk of layouts.

    Depending on your CSS usage, div-and-CSS usage may also allow you to include your content in your HTML document in an order than is irrespective of their position and flow on the page.  This can be somewhat beneficial from a search engine optimization (SEO) point of view, as some search engines (such as Google) tend to place a bit more weight on keywords in content closer to the beginning of the HTML file (although how much of an effect this is is debatable).  So, in this method (and assuming the appropriate CSS approach), you can put your page's real content first in the file, regardless of where it actually appears with respect to headers, ads, navigation links, etc.

    Author Comment

    Thanks guys.  

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System ( introduces the Login System and shows how to implement a login page. The EE Collaborative Logiā€¦
    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now