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

有帮助吗?

解决方案

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

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top