html - 表格是否被 DIV 取代?

标签 html css html-table

<分区>

Possible Duplicate:
Why not use tables for layout in HTML?

我知道现在每个人都在关注 DIV 和 css 而反对表格,我一直使用表格,因为它们很容易让我在构建时直观地看到我在做什么,我现在才冒险进入 DIV 世界。

所以我的问题是表格通常完全被 div 取代了吗?我在 stackoverflow 的来源上注意到它主要是 DIV,但仍然使用表格,所以我猜有时必须使用表格?

下面是我想要完成的事情的图像,其中大部分是编码的,但其中一些是在 photoshop 中添加的,到目前为止,我已经在 div 中完成了所有操作,但是我所拥有的只是背景单元格,它们是一个列表项和照片,我的代码中缺少的是所有文本区域,我可以非常容易地将文本区域定位在表格单元格中,但是因为大约 80% 的对象仅使用 css 和div 我不确定我是否应该只尝试使用 div 来完成它,或者评论 div 中的表格是否是可行的方法。

我注意到这个页面上的答案是一个 DIV 内的表格 alt text http://img2.pict.com/e0/4e/de/1486585/0/screenshot2b15.png

最佳答案

为了在语义上正确,表格应该只用于表格数据而不是用于布局页面。

David Dorward在评论中引起了我的注意。根据HTML 4.01 Specification关于 Tables in HTML Documents 的部分:

Tables should not be used purely as a means to layout document content as this may present problems when rendering to non-visual media. Additionally, when used with graphics, these tables may force users to scroll horizontally to view a table designed on a system with a larger display. To minimize these problems, authors should use style sheets to control layout rather than tables.

关于html - 表格是否被 DIV 取代?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1293698/

相关文章:

html - 如果盲人用户无法通过 Tab 键访问信息文本,那么他们将如何访问信息文本呢?

javascript - 无法使用可选择的 jQuery UI 获取选定的单词

javascript - 如何从 <table><tr><td></td></tr></table> 获取特定的 HTML 控件并将所选控件附加到同一个 <td> 中?

javascript - 随着屏幕宽度的变化缩小和扩大表格宽度

jquery - 使用选择框将 HTML 表格转换为 JSON

html - anchor 标签在悬停和事件时更改图像

html - Bootstrap 表行大小调整错误

javascript - 单击时创建 "box-webpage"

html - 100% 宽度,背景重复

android - phonegap 应用程序上的 3 点 android 菜单 - 由原生​​ android 控件触发