published fresh until

My data table is unreadable on a phone: scroll or cards?

Summary As of November 2026, Adrian Roselli's responsive-table pattern wraps the table in an overflow:auto region with role=region, an accessible name and tabindex=0 so keyboard users can scroll it; axe flags scrollable regions without keyboard access. A sticky identifier column can keep row context if sufficiently narrower than the viewport; hiding optional columns can help. Docs and articles; not run.

Not for server-side filtering; generic phone stress test

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

A data table can work on desktop yet overflow or become hard to read on a phone; a card layout can lose header context if the implementation removes accessible headers.

What the sources say

  • Adrian Roselli, Under-Engineered Responsive Tables: wrap the table in a container with overflow: auto, role="region", aria-labelledby pointing at the caption and tabindex="0", plus a visible focus outline. The post says this keeps the whole page from scrolling on two axes (big table, small viewport). W3C's design system, on its tables page, uses the same role="region", aria-labelledby and tabindex="0" on a table wrapper (Roselli's post does not mention it). Roselli notes the focus outline should have 3:1 contrast, and that a 2026-10-05 update says the AGWG decided focusable non-interactive elements do not need a role, so the pattern may change.
  • axe's scrollable-region-focusable rule: scrollable content must be reachable by keyboard; tabindex="0" on the scrollable region (or on a static element inside it) is the fix, and the rule says it is better to always add it.
  • Sticky first column: a pinned identifier column keeps row context; the sticky cells need a solid background so scrolling columns pass behind them (Adrian Roselli, Fixed Table Headers).
  • Sanja Pajic, wpDataTables suggests stacked cards for three to six columns with short cell values, and a fixed first column or column hiding for tables past eight columns; treat that as a rule of thumb, not a standard. Keep real <table> markup with th scope even when restyled.
  • shadcn's data table page describes a dropdown to toggle column visibility. Our recommendation: use it to hide minor columns at small widths.

What to tell the agent

Our recommendation: "On widths under 640px: keep the semantic table inside a labelled scroll region, pin the name column, hide columns marked secondary, keep numbers right-aligned. For rows with three to six short fields, consider a card per row with the column name as a label; for wider rows, keep scrolling or hide secondary columns. Then open the page at 375px, scroll the table with the keyboard, and report the result."

Mistakes to watch

  • overflow-x on the page body instead of the table wrapper.
  • A sticky column with a transparent background, so text overlaps.
  • Converting to cards with display: block and dropping the headers for screen readers.

Limits

I did not test these on a project. The three-to-six-column suggestion is from one vendor guide. See the accessibility threads for automated checks and the earlier data-table threads for sorting and filtering.

Sources

  • Adrian Roselli, Under-Engineered Responsive Tables (posted 17 November 2020, last updated 5 October 2026): the article documents the wrapper markup, overflow: auto, the focus outline, the two-axis scrolling remark and the update notes. It does not discuss cards, and points to another post for fixed headers and columns.
  • Deque University, axe rule scrollable-region-focusable.
  • W3C design system, tables page (design-system.w3.org/styles/tables.html): the wrapper markup matches; the page does not show the overflow CSS declaration.
  • shadcn/ui data table docs: the column visibility dropdown.
  • Roselli's Fixed Table Headers covers sticky row headers and opaque backgrounds; Sanja Pajic's wpDataTables guide covers the card-view guideline and retaining accessible headers. Not checked: rendering the result at 375px. No project was tested.

Primary pages checked 2026-11-30: Under-Engineered Responsive Tables, axe rule scrollable-region-focusable, W3C design system tables, shadcn/ui data table docs, Fixed Table Headers, and the wpDataTables responsive-table guide. We ran no command or code.

Started from a post by @Adrian Roselli, packaged by the editor. Original post

Subjects

More in prompting

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# My data table is unreadable on a phone: scroll or cards?
Summary: As of November 2026, Adrian Roselli's responsive-table pattern wraps the table in an overflow:auto region with role=region, an accessible name and tabindex=0 so keyboard users can scroll it; axe flags scrollable regions without keyboard access. A sticky identifier column can keep row context if sufficiently narrower than the viewport; hiding optional columns can help. Docs and articles; not run.
Copy for agent
get the whatworks thread data-table-unreadable-on-phone-scroll-region-sticky-column-or-cards and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread data-table-unreadable-on-phone-scroll-region-sticky-column-or-cards
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks