THE GITHTML FIELD GUIDE
Do not erase data-table semantics with a presentation role
Remove role=presentation or role=none from a real data table when readers need its row and column relationships. Those roles suppress semantics rather than merely simplifying appearance. Use CSS for visual changes, and reserve presentation roles for genuine layout structures whose native semantics would otherwise be misleading.
Understand the access barrier
A table may be styled like cards while still containing data that readers compare by row and column. Removing its semantics can leave values without the header relationships that explain them. The text remains, but an important part of its meaning disappears.
Use a deliberate document pattern
Ask what relationships the table communicates before changing roles. If it is actually a layout table, consider replacing it with simpler structural elements. If it is data, retain table markup and improve its headers, caption, and overflow treatment.
- Classify the structure as data or layout based on its relationships.
- Use CSS rather than presentation roles to alter a real data table's appearance.
- Verify header associations after any visual restructuring.
<table><caption>Response times by region</caption><tr><th scope="col">Region</th><th scope="col">Median</th></tr></table>Check the actual reading experience
Navigate by cells with a screen reader and confirm that values retain their relevant context.
Preserve the question each cell answers
Consider a table with regions in rows and median latency in columns. A value of 120 is meaningful only when the reader knows the region, measurement, and unit. Applying role=presentation to make the table sound less verbose can remove the structural relationships that provide that context. The correct response to excessive verbosity may be clearer headers or a simpler table, not erasing the table’s identity while leaving its visual grid intact.
Use a caption that identifies the comparison and provide actual data cells beneath the example header row. A simple table can often use column headers and row headers with explicit scope. More complex relationships may require additional associations, but avoid layering ARIA roles over valid native markup without a demonstrated need. Presentation semantics can also affect required structural descendants, so inspect the complete accessibility tree rather than checking only whether the outer table still has a name.
For a genuine layout table, such as an old email-style export used only to position a logo beside an address, removing misleading table semantics can be appropriate. Better still, rebuild the layout with suitable non-table structure when the publishing pipeline permits it. Classification depends on meaning: can a reader answer a row-and-column comparison question, or are the cells merely positioning unrelated content? After any repair, ask a nonvisual reader to identify a specific value and its headers. Then check the narrow-screen layout separately; keeping semantics does not solve clipping, unreadable widths, or an inaccessible horizontal-scroll region by itself.
Sources and further reading
AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.