Decision guide · Data Display And Exploration

Table UX: when to use a table, list, or data grid

Use a table when aligned attributes help people compare records. Add a grid interaction model only when cell navigation or editing is part of the task. Sorting and a few row actions alone do not turn a table into a spreadsheet.

Worked decision · constructed example

Does the task need comparison across columns or movement between editable cells?

A reviewer compares vendor payments by status, due date, and amount. Atlas Office is pending at $1,240, Blue Harbor is approved at $860, and Civic Print is pending at $2,140. The reviewer needs the largest pending payment and a clear action for that vendor.

Follow the review task rather than choosing a spreadsheet by appearance
Task stepTable behaviorCheck the result
Compare paymentsKeep each vendor in a row and each shared attribute in its column.The caption and headers explain what each value represents.
Sort by amountReorder the full matching set, then display the current page.The active sort and the visible row order agree.
Filter to pendingRecompute the matching set and the page count.The filter, row count, and displayed payments describe the same set.
Open Civic PrintUse a row action labelled for that vendor.The opened record matches the action's accessible name.

Why this choice

Aligned columns make the comparison explicit. A card layout may work better when imagery and uneven descriptions drive recognition. An editable budget worksheet is a different task and may justify a data grid with managed keyboard focus.

Where the decision changes

Choose a narrow-screen strategy for the actual task. A scrollable comparison table and a stacked record list preserve different scanning relationships. Keep labels available and test access to every column; wrapping values alone is not a responsive strategy.

Try these checks

  1. In the lab, sort Amount and inspect the announced sort state.
  2. Filter to Pending, move a page, and check that counts and order remain synchronized.
  3. Follow a named row action and verify its record context.
  4. Test headers, sort controls, and horizontal scrolling with keyboard and assistive technology.

What the sources support

  • APG treats tables as tabular structures rather than composite keyboard widgets. W3C APG: Table ↗

  • USWDS documents captions, header associations, sort announcements, and focusable scroll regions. USWDS: Table ↗

  • APG describes the additional focus-management responsibilities of interactive grids. W3C APG: Grid ↗

These source claims were checked on . The scenario and decision analysis are illustrative; the checks are a test plan, not reported results from a user study.

Decision first

Choose this pattern when the problem matches

Use when

  • Records share comparable attributes that users need to scan in aligned columns.
  • Users need to reconcile, audit, triage, sort, filter, or compare records.
  • Column headers and row identity can remain stable across responsive layouts.

Avoid when

  • The task depends on rich previews, imagery, or uneven metadata.
  • Users need spreadsheet-like editing or cell-by-cell keyboard navigation.

Problem it prevents

The items share a stable set of attributes such as name, status, owner, due date, amount, count, or last updated time.

Test the behavior

Try strong and weak versions of the interaction

Open the working example, try its controls, and compare the behavior against the decision guidance.

In the lab you can
  • switch between strong UI, weak UI, strong UX, and weak UX;
  • trigger required, empty, loading, error, and recovery states;
  • inspect keyboard and accessibility expectations beside the demo.
Launch Table in the lab
Pattern anatomy

What a strong implementation has to make clear

User need

The items share a stable set of attributes such as name, status, owner, due date, amount, count, or last updated time.

Pattern promise

Present records in a semantic table with a caption, clear column and optional row headers, aligned values, declared sort and filter state, responsive header preservation, and a boundary between read-only comparison, row actions, and richer data-grid tasks.

Required state

Default table state with caption, visible headers, row values, and result count or context.

Failure to inspect

Mobile stacking removes headers and turns rows into unlabeled paragraphs.

Access contract

Use native table semantics for tabular data rather than div-only rows.

Quality bar

The difference between expert and weak execution

Strong implementation

Specific, visible, recoverable

  • A payment review table has the caption June vendor payments, headers Vendor, Status, Due date, Amount, and Action, right-aligned amounts, and row actions labelled by vendor.
  • A narrow layout stacks each payment row while repeating labels such as Status and Amount before values.
  • A user sorts by Amount descending, filters to Pending, moves to page 2, and the table keeps its caption, active sort, active filter, row count, and selected payment context.
  • A keyboard user activates the Due date header, hears the changed order, and focus remains on the header rather than jumping into the first row.
Weak implementation

Vague, hidden, hard to recover from

  • Mobile stacking removes headers and turns rows into unlabeled paragraphs.
  • Row actions run against the wrong record because labels only say Edit or Delete.
  • Pagination, sorting, or refresh loses selected rows, expanded rows, focus, or scroll position.
  • The interface calls itself a table even though users need editable grid behavior.
UI guidance
  • Render a table with a specific caption or heading, visible column headers, optional row headers, aligned values, consistent row actions, and enough spacing for scanability.
  • Show sort, filter, pagination, selection, and responsive states without breaking the visible relationship between each header and cell.
UX guidance
  • Use tables when aligned columns help users compare records, find exceptions, audit values, or triage work faster than opening each item.
  • Preserve row meaning, focus, selection, sort, filter, pagination, and header labels as users update or inspect the table.
Implementation contract

What the implementation must handle

States

  • Default table state with caption, visible headers, row values, and result count or context.
  • Sorted table state with current sorted column and direction exposed visually and programmatically.
  • Filtered table state with active criteria near the table and updated row count.
  • Selected-row state when the table supports row selection or bulk action.

Interaction

  • Column headers identify the values below them and remain associated with cells in desktop, stacked, and horizontally scrolled layouts.
  • Row headers identify each record when the first column is the record name or primary identifier.
  • Sortable headers update row order, active indicator, accessible sort state, and result summary together.
  • Filtering updates row membership while preserving current sort unless the design explicitly resets it.

Accessibility

  • Use native table semantics for tabular data rather than div-only rows.
  • Add a caption or programmatically associated label that identifies the dataset.
  • Use th for headers and td for data cells.
  • Use scope for straightforward row or column headers and id or headers for complex grouped headers.

Review

  • What does one row represent, and what does each column mean?
  • Is there a caption or heading that names the dataset and table purpose?
  • How are headers preserved in responsive, sorted, filtered, and paginated states?
  • Are row actions, selections, and expanded content tied to the correct record?
Evidence trail

Source-backed claims behind this guidance

WAI Tables Tutorial

W3C Web Accessibility Initiative - checked

WAI table guidance supports semantic headers, data cells, captions, scope, and complex header associations.

MDN: HTML table element

Mozilla Developer Network - checked

MDN table documentation supports table structure, captions, sectioning, header scope, and accessibility considerations.

U.S. Web Design System Table

U.S. Web Design System - checked

USWDS table guidance supports responsive, stacked, sortable, and stateful table behavior.

Carbon Design System Data Table

Carbon Design System - checked

Carbon data table guidance supports sorting, toolbar separation, row selection, expansion, and pagination placement.

Maersk Design System Table

Maersk Design System - checked

Maersk table guidance supports clickable column headers, sort modes, and relationships between table sorting, searching, and filtering.

Full agent/debug reference

Problem Context

  • The items share a stable set of attributes such as name, status, owner, due date, amount, count, or last updated time.
  • Users need to scan down columns, compare values across rows, or find differences between records.
  • The table may sit near search, sort, filters, pagination, row actions, expandable detail, or bulk selection controls.
  • The product can define which columns matter, how headers map to values, and what happens at narrow widths.

Selection Rules

  • Choose table when each row represents one record and each column represents the same attribute for every row.
  • Use table for comparison, audit, reconciliation, inventory, queue, billing, status, and report tasks where aligned columns reduce effort.
  • Use a data grid when users edit cells, navigate between interactive cells with arrow keys, or perform spreadsheet-like operations.
  • Use list view when items are primarily scanned as summaries and shared columns are secondary.
  • Use card list or card grid when item imagery, uneven metadata, or rich object previews matter more than column alignment.
  • Use sort controls or sortable headers to change row order, but keep sorting separate from filtering and pagination state.
  • Use filter panel to change which rows are included, not to rename or hide table columns without clear table-state feedback.
  • Use pagination, virtual loading, or a saved view when the row count is too large for one table view.
  • Avoid table when there are fewer than two comparable attributes or when every row needs a different layout.
  • Avoid layout tables for positioning page content.

Required States

  • Default table state with caption, visible headers, row values, and result count or context.
  • Sorted table state with current sorted column and direction exposed visually and programmatically.
  • Filtered table state with active criteria near the table and updated row count.
  • Selected-row state when the table supports row selection or bulk action.
  • Row-action state with actions associated to the correct row.
  • Empty table state after filters or search remove all rows.
  • Loading or updating state while table rows refresh.
  • Responsive state that preserves header-to-cell meaning.
  • Overflow state for wide tables with visible horizontal scroll or column-priority rules.
  • Error state when rows cannot load while table structure and retry path remain visible.

Interaction Contract

  • The table caption or nearby heading names the dataset and purpose, not just Table.
  • Column headers identify the values below them and remain associated with cells in desktop, stacked, and horizontally scrolled layouts.
  • Row headers identify each record when the first column is the record name or primary identifier.
  • Sortable headers update row order, active indicator, accessible sort state, and result summary together.
  • Filtering updates row membership while preserving current sort unless the design explicitly resets it.
  • Pagination moves through the same sorted and filtered table without losing row meaning.
  • Row actions, links, checkboxes, and expansion controls are labelled with the row they affect.
  • Keyboard focus remains stable after sort, filter, pagination, row selection, expansion, or refresh.

Implementation Checklist

  • Define the row object, column attributes, primary row header, caption, and optional table description.
  • Use table semantics with caption, thead, tbody, th, td, scope, and row or column headers appropriate to the complexity.
  • Use id and headers associations for complex grouped headers when scope alone is insufficient.
  • Align numeric values, dates, status tags, and row actions consistently.
  • Show active sort and filter state near the table and synchronize it with row count and pagination.
  • Label row actions and selectable rows with the record identity.
  • Choose a responsive strategy: horizontal scroll, stacked rows with labels, reduced columns, or a dedicated detail view.
  • Handle empty, loading, error, selected, expanded, sorted, filtered, and paginated states deliberately.
  • Test with keyboard, screen reader table navigation, zoom, high contrast, long labels, localized values, and narrow viewports.

Common Generated-UI Mistakes

  • Using table markup to create page columns or layout spacing.
  • Rendering div rows that visually resemble a table but expose no table, row, column, or header semantics.
  • Omitting the caption or visible dataset context.
  • Dropping column headers on mobile so values lose meaning.
  • Mixing sorting, filtering, search, pagination, and column visibility into one unlabeled control.
  • Turning a read-only table into an editable spreadsheet without data-grid keyboard behavior.
  • Putting too many columns, long paragraphs, and row actions into a cramped table.
  • Sorting formatted values by displayed text instead of raw date, amount, number, or status order.

Critique Questions

  • What does one row represent, and what does each column mean?
  • Can users compare values down a column and across rows without opening every record?
  • Is there a caption or heading that names the dataset and table purpose?
  • How are headers preserved in responsive, sorted, filtered, and paginated states?
  • Are row actions, selections, and expanded content tied to the correct record?
  • Has the table become an editable data grid, card list, or list view instead?
Accessibility
  • Use native table semantics for tabular data rather than div-only rows.
  • Add a caption or programmatically associated label that identifies the dataset.
  • Use th for headers and td for data cells.
  • Use scope for straightforward row or column headers and id or headers for complex grouped headers.
  • Expose sortable header state with aria-sort or equivalent state text.
  • Do not remove header labels in responsive layouts; repeat labels in stacked rows or preserve horizontal table navigation.
  • Give row actions and selection controls accessible names that include the row identity.
  • Avoid using role grid unless the table has data-grid interaction behavior.
Keyboard Behavior
  • Tab reaches interactive controls before, inside, and after the table in a predictable order.
  • Static table cells are read through table navigation rather than every cell becoming a tab stop.
  • Sortable headers are reachable as buttons and activate with Enter or Space.
  • Row checkboxes, row links, row menus, and expand controls are reachable in row order and identify the affected row.
  • After sorting, filtering, pagination, or refresh, focus remains on the triggering control or moves to a clearly announced table summary.
  • Horizontal scroll regions remain keyboard operable when the table overflows.
Variants
  • Basic table
  • Sortable table
  • Responsive stacked table
  • Scrollable wide table
  • Selectable-row table
  • Expandable-row table
  • Numeric table
  • Compact table
  • Comparison table
  • Results table

Verification

Source trail checked:

Saved items