跳到正文
Skillpedia
网站与界面(前端)75k · #2711

accessible-tables

它能做什么

这项技能检查数据表格是否使用了正确的表头和标题,以便屏幕阅读器能够说明表格内容。适合制作价格、结果或时间表等表格的网页开发者。

适用场景

  • ✓当你在网页上制作数据表格时。
  • ✓当表格的表头单元格没有被标记为表头时。
  • ✓当表格被用于页面布局而不是展示数据时。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/accessible-tables/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/accessible-tables/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请检查我的价格表,让屏幕阅读器能够说明每个数字属于哪个套餐。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会检查表格标记中的表头单元格、scope 属性和标题,并确认表格只用于展示数据,而不用于布局。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Use semantic table markup for screen readers

Screen readers read table data cell-by-cell—without proper headers, users hear meaningless numbers without context. 'Row 3, Column 2: $99' vs just '$99'.

Quick Reference

  • Use <th> elements for headers with scope='col' or scope='row'
  • Add <caption> to describe the table's purpose
  • Never use tables for layout—use CSS Grid or Flexbox instead
  • Use id/headers for complex tables with merged cells
  • For simple tables with a clear adjacent section heading, missing scope is often a stronger finding than missing <caption>
  • Prefer one strong table-semantics finding over multiple weaker enhancements on the same simple table

Check

Verify tables use proper th elements with scope, caption or aria-labelledby, and semantic table structure.

Fix

Add proper table headers with scope attributes, captions for context, and ensure tables are not used for layout.

Explain

Explain how proper table markup helps screen reader users understand data relationships and navigate table content.

Code Review

Review the rendered markup and interactive states that affect Use semantic table markup for screen readers. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/accessibility/accessible-tables

常见问题

表格中的 scope 是什么?

它告诉屏幕阅读器,表头适用于一列还是一行。

每个表格都需要标题吗?

这项技能说明,标题会有帮助,但在一个有清晰标题的简单表格中,缺少 scope 通常是更重要的修复项。

我可以用表格做布局吗?

不可以。这项技能建议改用 CSS Grid 或 Flexbox 来做布局。

详情

作者的原始描述

Use when reviewing rendered HTML, interactive components, or design-system patterns related to Use semantic table markup for screen readers. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#2711
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能