WCAG 2.0 使用表格进行布局

发布于 2024-11-15 02:35:14 字数 50 浏览 6 评论 0原文

WCAG 2.0 是否允许表格布局,我在指南中看不到任何内容说不能,但这让我感到惊讶。

Does WCAG 2.0 allow tables for layout, I can't see anything in the guidelines saying you can't but this suprises me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

以酷 2024-11-22 02:35:14

http://www.w3.org/TR/WCAG20-TECHS/H73.html

虽然 WCAG 2 并没有禁止
使用基于 CSS 的布局表
建议布局以便
保留定义的语义
HTML 表格元素并符合
分离的编码实践
内容呈现

http://www.w3.org/TR/WCAG20-TECHS/H73.html

Although WCAG 2 does not prohibit the
use of layout tables, CSS-based
layouts are recommended in order to
retain the defined semantic meaning of
the HTML table elements and to conform
to the coding practice of separating
presentation from content

我一直都在从未离去 2024-11-22 02:35:14

我想在 @jordan 的回答中补充一点,叠瓦式的桌子是无法访问的。
布局表必须避免使用数据表中使用的任何元素,即:

  • captiontheadtfootth 元素(仅限 tabletrtd 和可选的 tbody
  • summary属性(可以为空),headersscope(只有rowspancolspan。显然还有id
  • 奇怪的东西,比如axiscol 元素

还必须是可线性化的,即从上到下、从左到右读取单元格时必须有意义。

相关 WCAG 2.0 故障技术为:

注意:如果您仅将表格用于设计约束,那么仅供参考,您可以使用 display: table; (和 table-row< /代码> 和table-cell) 适用于除 IE6 和 IE7 之外的所有浏览器。

I'd add to @jordan answer that imbricated tables are inaccessible.
A layout table must avoid using any element used in data tables, that is:

  • no caption, thead, tfoot and th elements (only table, tr, td and optionally tbody)
  • summary attribute (it can be empty), headers, scope (only rowspan and colspan. And id obviously)
  • strange things like axis or col element

It must also be linearizable, that is, must make sense when cells are read from top to bottom and left to right.

Relevant WCAG 2.0 Failure Techniques are:

Note: if you're using tables only for design constraints, then FYI you can use display: table; (and table-row and table-cell) on every browser except IE6 and IE7.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文