Explore behaviors before defining the interface.
Quick guide for designers
Always consider the context of the application, even when the guidance follows a standard pattern. Interaction design documents intent. Behavior must be verified in the implementation.
When to use
Use for data that needs comparison across rows and columns.
What to design
Show headers, sorting, row selection, batch actions, and expandable details when present. Include loading, no records, and reading on small screens.
How it behaves
Static cells need no focus. Internal controls follow their own patterns; scrolling must work by keyboard when needed.
What to document in Figma
Document header and data relationships, sorting and selection scope, persistence when filtering or paginating, and focus after collapsing details or executing actions.
How to review
Check whether the purpose and states are clear on small and large screens and with zoom. Verify documented behavior in the implementation, including keyboard and screen reader use where applicable.
Full guidance
Interaction Design
Questions to ask when designing components of type Tables.
Important:
Depending on the context in which you build your components, there may be further questions, and some listed here may not be necessary. Assess each case individually.
Designing for "no interaction"
- Before reading the data, can you perceive the relationship between rows and columns?
- Does the table have a title or caption explaining its purpose?
- Are row and column headers visually clear?
Designing for mouse use (any pointing device)
- When the table offers sorting or actions, does the control provide visual feedback?
- Are clickable areas inside cells distinguishable from static data?
- Does a horizontally scrolling table indicate that more content is available?
Designing for gesture use
- On small screens, does the table remain readable and understandable?
- Is horizontal scrolling easy to perform, if present?
- Does responsive reorganization preserve headers and data relationships?
Designing for keyboard use (any non-pointing device)
- Can a horizontally scrolling table receive focus to allow keyboard scrolling?
- Do sorting and action controls have visible focus?
- Does focus order follow the visual and logical order of the data?
Designing for screen reader use
- Is the table caption or title announced?
- Are column and row headers associated with the data?
- Are sorting changes announced when applicable?
Editorial extension — interaction patterns and decisions
Magoo editorial adaptation: extends the previous guidance with design, documentation, and review decisions. References support the adaptation; these scenarios do not represent executed tests or certification.
Sorting, selection, and batch actions
Use a table for relationships between rows and columns. Buttons, links, and checkboxes inside cells do not automatically turn it into an interactive grid. Reserve the grid pattern for an interaction need that justifies its dedicated navigation.
For sorting, distinguish sortable columns, the currently sorted column, and direction. Document initial order, direction cycling, tie handling, and whether sorting covers the full dataset or only the page.
For row selection, show individual, partial, and full selection. Define whether Select all includes visible rows, the current page, or all filtered results. Explain quantity and scope before a batch action.
Document what happens to selection when sorting, filtering, or paginating. After a batch action, present success, partial failures, and next steps while retaining identification of affected records.
Expandable details and data states
Use a button per row to expand details, with a name identifying the record and an expanded or collapsed state. Define whether multiple rows may remain expanded. When collapsing details that contain focus, return focus to the button before hiding the content.
Design loading, no records, no filter matches, and update failure as distinct situations. On small screens and with magnification, preserve headers, record identification, and access to actions, including batch actions.
Design and implementation review
In the design, check that sorting, selection, and action scope can be recognized without relying on color alone. In the implementation, verify associated headers, sorting state, control names for each record, and access to details with keyboards and screen readers.
Scope: the basic methods below describe HTML tables with independent controls. Sorting, selection, batch actions, and expandable details are covered in the editorial extension of the Interaction design tab.
Interaction Methods
Possible interaction methods for components of type Tables.
Important:
Only the main methods are listed here. Custom components require further study.
Mouse interaction (any pointing device)
- Static tables require no interaction.
- Clicking a sortable header changes the sort order when that feature exists.
- Links and buttons inside cells follow their own patterns.
Keyboard interaction (any non-pointing device)
- Static tables should not add focus to cells unnecessarily.
- Internal controls should be reachable with
TAB. - When a table scrolls horizontally, focusing the scrollable region and using
arrow navigationreaches data outside the visible area, depending on the browser.
Keyboard (or gesture) interaction + screen reader
- On reaching the table with screen reader commands, people identify its title or description.
- Using screen reader cell navigation commands relates each value to its headers.
- When traversing a complex table with screen reader cell commands, people identify headers corresponding to the current data.
Gherkin
BDD (Behavior-Driven Development) methodology focusing on three pillars: User Stories, Acceptance Criteria, and Gherkin Syntax (Given, When, Then).
Scenario: Given that I am on a page containing tables
Keyboard navigation
- WHEN I use the keyboard to navigate a table with interactive controls
- I SEE visible focus on available controls
- THEN, when the table has horizontal scrolling
- I SEE that I can access and scroll the container when needed
Screen reader on desktop
-
When I use a screen reader on a computer (NVDA, JAWS, VoiceOver) and navigate the component
- I HEAR the table's title or caption.
- I HEAR that the content is a table.
- I HEAR the headers associated with data cells.
- THEN, when I interact with the component, when applicable
- I HEAR or perceive that the corresponding information, state, content, or action is available.
Screen reader on mobile devices
-
WHEN I use a screen reader on a phone (TalkBack, VoiceOver) and swipe to navigate the component, the following happens:
- I HEAR the table's title or caption.
- I HEAR that the content is a table.
- I can understand the relationship between headers and data.
- THEN, when I interact with the component, when applicable
- I HEAR or perceive that the corresponding information, state, content, or action is available.
Additional scenarios — editorial extension
Sort without losing context
- GIVEN a sortable column
- WHEN I activate its control using the keyboard
- THEN records follow the indicated direction, focus remains on the control, and the new sorting state is available to a screen reader.
Selection and batch action scope
- GIVEN selected rows
- WHEN I filter or change pages
- THEN selection follows the documented rule and the count and scope of affected records are clear before a batch action.
Collapse details containing focus
- GIVEN expanded details with focus on an internal control
- WHEN the details collapse
- THEN focus returns to the row expansion button and the collapsed state can be perceived with a screen reader.
Considerations
Considerations for components of type Tables.
- Do not use tables for visual layout.
- Complex tables require more careful association between headers and cells.
- Responsive versions should not remove important semantic relationships.
Implementation notes and behavior decisions
- A scrollable container can receive
tabindex="0"to allow keyboard scrolling.
- Use
captionfor the table title or description.
- Use
thwithscopefor simple headers.
- Complex tables should associate headers and cells programmatically.
References
Additional references for components of type Tables.
Important:
Most references are on the course platform alongside the lessons cited in this material.
Disclaimer:
The links listed here are a curated collection of references where you can find implemented components, rather than recommendations. There is no unified implementation format and no guarantee that these links follow every design pattern. Direct questions to the teams responsible for the linked materials. Before copying a model, remember that all materials are constantly updated and that patterns, particularly proprietary ones, may change.
Design patterns
- HTML standards documentation: The Table Element open_in_new (external link, opens in a new tab)
- W3C APG: Table Pattern open_in_new (external link, opens in a new tab)
- W3C WAI: Tables Tutorial open_in_new (external link, opens in a new tab)
Design System
- US.gov - Table open_in_new (external link, opens in a new tab)
- IBM Carbon - Data table open_in_new (external link, opens in a new tab)
- Adobe Spectrum - Table open_in_new (external link, opens in a new tab)
- Bootstrap - Tables open_in_new (external link, opens in a new tab)