为什么div比表更适合设计 [英] why divs are more preffered than table for designing

查看:65
本文介绍了为什么div比表更适合设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么div比表格更适合设计?

解决方案

实际上,没有人阻止你使用表格进行设计。



但常见的论点是:引入表来为数据提供结构。通过为数据提供结构,我的意思是提供一些表格数据,例如Excel表格。



简答:当前的HTML5标准,它的支持跨主流浏览器 - 允许在不使用表的情况下掌握不同复杂度的布局。 Divs - 是布局的砖块 - 因此使用它们是最合理的。





长期历史性答案



很久以前,在HTML 3.2规范中

http://www.w3.org/TR/REC-html32.html#body [ ^ ]有人提到,[tables] ...可以用于标记表格材料或用于布局目的。但同样,建议过去经验的智慧鼓励我们将文档中的结构信息与呈现信息分开。将它们混合在一起最终会导致维护文档的拥有成本增加,并降低应用程序和媒体之间的可移植性

why divs are more preffered than table for designing?

解决方案

Actually, nobody prevents you from using tables for designing.

But common argument is: tables were introduced to provide structure to data. By "providing structure to data", I mean presenting some tabular data, like Excel sheet, for example.

Short Answer: current HTML5 standard, it''s support across major browsers - allows mastering layout of different complexity without use of tables. Divs - are bricks of the layout - thus it''s most reasonable to use them.


Long Historic Answer

Long time ago, in HTML 3.2 spec
http://www.w3.org/TR/REC-html32.html#body[^] it was mentioned, that [tables] ... can be "used to markup tabular material or for layout purposes". But again, it was recommendation "The wisdom of past experience encourages us to separate the structural information in documents from rendering information. Mixing them together ends up causing increased cost of ownership for maintaining documents, and reduced portability between applications and media"


这篇关于为什么div比表更适合设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆