开发者

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

开发者 https://www.devze.com 2023-03-10 22:41 出处:网络
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?

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 in开发者_如何学编程stance 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.


I have recently adopted the Blueprint Grid CSS Framework, and really love it. It makes it easy to use divs to layout, without worrying about doing the positioning.

You should read the source. It's very simple, and does use some relative positioning under the hoods. Mostly, it just uses fixed widths to make the grid.

There are many competing frameworks -- some support liquid layouts (non-fixed width).


Yes, you should try. Use tables only for tabular content.

For starters: From table hell to div hell?

And no: using div's for layout doesn't require positioning, but that depends on the design.


Tables should be used for representing tabular data, not for making layouts.

This is a hot topic about this with excellent answers: Why not use tables for layout in HTML?

Layouts without the use of tables aren't necessary to be created with absolute positioning. In tutorials 8 and 9 of this page liquid div layouts are being explained thoroughly, without the use of absolute positioning.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号