Tables across viewports
Applies to Mobile to large desktop
A table does not shrink well. Decide which columns matter most, then pick a pattern for each width.
- Mobile
- Stacked rows, key and value pairs, card-like row details or expandable rows
- Tablet
- Fewer columns, chosen by priority; sideways scrolling only when needed
- Laptop
- The full table: sticky header, resizable columns, bulk actionsSame as desktop
- Desktop
- The full table: sticky header, resizable columns, bulk actions
- Large desktop
- The full table: sticky header, resizable columns, bulk actionsSame as desktop
Depends on whether people compare across rows, how many columns matter, touch or pointer. A starting point, not a correct value.
Why?
On a wide screen people compare down columns. On a phone there is room for about two columns, so comparison has to give way to reading one row at a time.
When to use it
- Stacked or key and value rows when people look up one record.
- Column priority when a few columns carry most of the meaning.
- Sideways scrolling when the data is truly tabular and people compare across it.
When not to
- Do not shrink every desktop column to fit a phone.
- Do not hide a column on mobile that people need to complete the task.
Common mistakes (3)
- Tiny text so that every column fits.
- Sideways scrolling with nothing showing that more is off screen.
- Bulk actions that only exist on desktop.
Official guidanceWCAG
- WCAG
Content must work at 320 CSS pixels without scrolling in two directions. Data tables that need two dimensions are exempt.
WCAG 2.2, SC 1.4.10 Reflow(opens in a new tab)Standard requirement
Applies to all viewports