Using a table or div

What is the best practice when creating our web page div or table?

Someone says it is recommended to use a div, but I found that controlling the size and alignment with the div is not easy.

What is your opinion?

+3
source share
5 answers

It all depends on what you want to display :

  • <DIV>and <SPAN>for page layout
  • <Table> Designed to display tabular data (such as data points, etc.)

The days of use <Table>for entire page layouts have disappeared - and you should not be encouraged to use them for this reason.

HTML- semantic. , - , ( )

+9

- , . , TABLE , DIV SPAN .

+2

: http://www.smashingmagazine.com/2009/04/08/from-table-hell-to-div-hell/

( , , Stack Overflow), div. div - , .

1990- , div s.

+1

. divs stylesheets.

divs , , .

, , , , , , .

+1

I would say that div is definitely the industry standard for website layouts. They can be rather cumbersome to work with at first, but as soon as you think about how they are located, you will never look at the tables again.

Try this tutorial to move from tables to divs. http://www.devarticles.com/c/a/Web-Style-Sheets/DIV-Based-Layout-with-CSS/

+1
source

Source: https://habr.com/ru/post/1784938/


All Articles