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?
DIV
TABLE
Clarification: This question is general and specific, as I am mainly looking for what would be more ideal for the page layout.
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.
thead
th
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
. , "" ""? , ? , . , .
(, excel). Div .
, .
Simple.
. div .
IMHO, a table , .
table
div, , , , . tables (, , ). .
div
tables
, ( ), - , . :
<table> <tr><td> List item 1 </td></tr> <tr><td> List item 2 </td></tr> </table>
<li>, <p> or <div> ( )
<li>, <p> or <div>
, , , - .. , . , , , .
i . div .
, , table div ( ), HTML . HTML , - .
, : (
, , , , IE6. , - html-, , , .
HTML , , , HTML5, ...
, , ... , - . "" -. , ! , : , .., (, Excel), - , . , , , , CSS . !