5

I've noticed a variation of convention when it comes to using DIV tags instead of TABLE to separate/organize content on a web-page. In what situation is one more appropriate to use than the other?

Clarification: This question is both general, and specific in that I'm mainly looking for which would be more ideal for page layout.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Jengerer
  • 1,163
  • 11
  • 27
  • 1
    It is a nice dream that elements are for displaying tabular data and
    elements are for page layout. The reality of poor CSS support in older versions (that may still be required) of browsers can force you to use
    elements to align stuff that is not tabular in nature but which needs to be aligned. I can't say that I like using table elements for alignment, but I also can't say to the client "I.E. 6 is a pile of poopy, upgrade you n00b!" either.
    – DwB Oct 20 '10 at 21:01
  • I don't think I need to ask, but I take it that `div` elements don't behave at all properly in IE6, huh? – Jengerer Oct 20 '10 at 21:05
  • 3
    IE6 has no problems with div elements. It is *very* hard to get a div element wrong as it does practically nothing. IE6 has rather a lot of bugs when it comes to stylesheets, but those bugs are pretty well documented and IE6 is becoming less important to support every day. – Quentin Oct 21 '10 at 05:42
  • Possible duplicate of [Why not use tables for layout in HTML?](https://stackoverflow.com/questions/83073/why-not-use-tables-for-layout-in-html) – Brian Tompsett - 汤莱恩 Jun 13 '17 at 07:33