Text
Table
Published on
Description
Tables present tabular data in rows and columns. Use semantic HTML table elements with proper header associations. It is absolutely fine to use tables for tabular data.
Example
Accessibility
- Use
scope="col"on column headers andscope="row"on row headers for proper screen reader cell-to-header association. - Include
<caption>oraria-labelledbyfor table identification. - Wrap tables in a scrollable container with
role="region",aria-labelledby(oraria-label), andtabindex="0"for keyboard-accessible scrolling. - Do not use CSS
displayproperties (flex, grid, block) on table elements — they strip table semantics. Useposition: stickyfor fixed headers instead. - Do not convert tables to ARIA grids unless building a spreadsheet-like interface with 2D arrow-key navigation.
- Avoid spanning headers — they cause inconsistent screen reader announcements across all tested assistive technologies.
References
- Under-Engineered Responsive Tables (opens in new tab) — Adrian Roselli
- Hey, It's Still OK to Use Tables (opens in new tab) — Adrian Roselli
- Tables, CSS Display Properties, and ARIA (opens in new tab) — Adrian Roselli
- Fixed Table Headers (opens in new tab) — Adrian Roselli
- Avoid Spanning Table Headers (opens in new tab) — Adrian Roselli
- Don't Turn a Table into an ARIA Grid Just for a Clickable Row (opens in new tab) — Adrian Roselli
Related
- Description list — for key-value data
Variables
None