When is it more appropriate to use a DIV instead of a TABLE and vice versa?

I noticed an agreement option when it comes to using tags DIVinstead TABLEto separate / organize content on a web page. In what situation is it best to use another?

Clarification: This question is general and specific, as I am mainly looking for what would be more ideal for the page layout.

+5
source share
11 answers

Generally, if each cell in a row has something in common, and each cell in a column has something in common, then you should use a table. If you do not have theadwith some elements thcontaining column headings, then there is a good chance that you are doing something wrong. If you do not have multiple rows of data and multiple columns of data, then ... ditto.

However, the choice is not between div and table. Use markup with semantics that best describes the content. HTML has many elements: http://www.w3.org/TR/html4/index/elements.html

+12
source

. , "" ""? , ? , . , .

+2

(, excel). Div .

, .

+1

Simple.

. div .

+1

IMHO, a table , .

, .

0

div, , , , . tables (, , ). .

0

, ( ), - , . :

<table>
  <tr><td>
  List item 1 
  </td></tr>

  <tr><td>
  List item 2
  </td></tr>
</table>

  <li>, <p> or <div> ( )

, , , - .. , . , , , .

0

i . div .

0

, , table div ( ), HTML . HTML , - .

, : (

0

, , , , IE6. , - html-, , , .

HTML , , , HTML5, ...

0

, , ... , - . "" -. , ! , : , .., (, Excel), - , . , , , , CSS . !

-1

All Articles