Is my understanding DIVs should be used instead of TABLEs to layout data

Is this correct and if so, where can I find a good resource to know how to do it , because, all the pages I've seen uses absolute position and things like that. Is this the correct way to go?

EDIT

So my question is , how to put two elements side by side, how one on top of other etc. Is it using absolute position?

For instance this page uses very little table and layout everything in using DIV.


Is this correct

Not quite. You should use the elements that best describe the semantics of the data, then use CSS to lay them out.

where can I find a good resource to know how to do it

See section 38 of the WSC: Headers, footers, columns, and templates. Possibly preceded by the earlier sections.


You should use DIVs + CSS for layout and TABLE for tabular data.

Here is a good article about the subject

A list apart: Practical CSS

This is a good page to start learning with practical examples CSS positioning


Yes, DIVs have been used for some years now. You should also checkout the new layout tags in HTML5 such as <nav> , <section> etc..

Look at this blog post for some interesting comparison of DIV vs tables.

链接地址: http://www.djcxy.com/p/88158.html

上一篇: 什么HTML结构对浏览器更好?

下一篇: 我的理解DIV应该用来代替TABLE来布局数据