HTML4.01 规范 (http://www.w3.org/TR/html401/struct/tables.html#adef-summary) 声明表格摘要属性应包含“...表格的用途和结构 ...摘要”以及给出的示例支持那种用法。
Web 内容可访问性指南 2.0 (http://www.w3.org/TR/WCAG20-TECHS/H73.html) 表示 summary 属性是“提供数据如何组织到表格中的简要概述或如何导航表格的简要说明”
WCAG 1.0 ( http://www.w3.org/TR/WCAG10-HTML-TECHS/#table-summary-info ) 说了类似的话,示例再次显示了描述表的目的和结构的用法。
另一方面,伊利诺伊信息技术无障碍中心 iCITA ( http://html.cita.uiuc.edu/nav/dtable/dtable-rules.php ) 将属性的最佳实践描述为“应该描述表格的内容或结论作者意在通过表格中的数据传达"
我怀疑 iCITA 是否突然选择了这一点,并且是否有其他 HTML 书籍和指南建议了类似的做法。
在很多方面,这样的用法对我来说更有意义,因为明智地使用 thead 和 th 元素以及 scope 和 headers 属性应该足以向非视力用户描述表的结构,而有没有其他方法可以让视力不佳的用户获得复杂表格的要点,以匹配视力正常的用户通过快速扫描表格可以获得的相同级别的信息。
但是,我不愿意背离 WCAG 的经过深入研究的建议。
所以,我的问题是:如果您在数据表的摘要属性中放置任何内容,您是否会输入目的、结构、内容描述、结论和/或其他内容,为什么?特别欢迎基于此属性的真实用户反馈的理由。
最佳答案
摘要属性已过时。如果表格标题元素不合适,则将表格放在图形元素中,在图形标题元素中添加附加信息。 axis 属性也已过时;相反,在适当的 th 元素上使用范围。
来自 W3C关于总结:
- The element table must not appear as a descendant of the caption element.
- The summary attribute on the table element is obsolete. Consider describing the structure of the table in a caption element or in a figure element containing the table element; or, simplify the structue of the table so that no description is needed.
- The align attribute on the table element is obsolete. Use CSS instead.
- The width attribute on the table element is obsolete. Use CSS instead.
- The bgcolor attribute on the table element is obsolete. Use CSS instead.
- The value of the border attribute on the table element must be either “1” or the empty string. To regulate the thickness of table borders, Use CSS instead.
- The cellpadding attribute on the table element is obsolete. Use CSS instead.
- The cellspacing attribute on the table element is obsolete. Use CSS instead.
- The frame attribute on the table element is obsolete. Use CSS instead.
- The rules attribute on the table element is obsolete. Use CSS instead.
来自 W3C关于轴:
- The scope attribute on the td element is obsolete. Use the scope attribute on a th element instead.
- The abbr attribute on the td element is obsolete. Consider instead beginning the cell contents with concise text, followed by further elaboration if needed.
- The axis attribute on the td element is obsolete. Use the scope attribute instead.
- The align attribute on the td element is obsolete. Use CSS instead.
- The width attribute on the td element is obsolete. Use CSS instead.
- The char attribute on the td element is obsolete. Use CSS instead.
- The charoff attribute on the td element is obsolete. Use CSS instead.
- The valign attribute on the td element is obsolete. Use CSS instead.
- The bgcolor attribute on the td element is obsolete. Use CSS instead.
- The height attribute on the td element is obsolete. Use CSS instead.
- The nowrap attribute on the td element is obsolete. Use CSS instead.
关于html - HTML 表 "summary"属性的使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/568905/