accessible-tables
它能做什么
这项技能检查数据表格是否使用了正确的表头和标题,以便屏幕阅读器能够说明表格内容。适合制作价格、结果或时间表等表格的网页开发者。
适用场景
- ✓当你在网页上制作数据表格时。
- ✓当表格的表头单元格没有被标记为表头时。
- ✓当表格被用于页面布局而不是展示数据时。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/accessible-tables/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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
scopeis 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.
热度
- GitHub 星标
- 75k
- 排名
- #2711
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。