liveBook · Manning

Data grid

As explained in Architecting Accessibility

A data grid is an interactive, spreadsheet-like tabular widget with two-dimensional keyboard navigation between cells.

A data grid presents tabular information with spreadsheet-like interaction: users move between cells in two dimensions, typically with arrow keys. Choose a grid when that navigation is needed; for reading or review, a native table is usually enough, even if it includes sorting, filtering, or interactive controls. section 6.2

Start with native table elements to preserve relationships between headers and data cells. Add role="grid" to communicate spreadsheet-like interaction to assistive technology. The role does not provide keyboard behavior: implement, test, and maintain keyboard navigation and focus management. section 6.2 section 6.2.2

Table 6.3 Outline of keyboard operations typically expected on a grid interactive widget
Group
Keys
Expected behavior
Navigation
Arrow keys, Home, End, Ctrl+Home, Ctrl+End, Page Up, Page Down
Arrow keys move focus between cells in two dimensions. Home and End move to the beginning or end of a row, while Page Up and Page Down move focus up or down a predetermined number of rows (especially useful with large grids). Ctrl+Home and Ctrl+End move focus to the first cell in the first row or the last cell in the last row, respectively.
Editing and interaction *
Enter, F2, alphanumeric keys, Escape, Tab, Shift+Tab, Arrow keys and Space
Enter cell interaction (or editing) mode with Enter or F2, and switch back to grid navigation using Escape (canceling any edits) or F2. If the cell contains more than one widget, the first widget receives focus. Pressing Enter again when a cell contains a single-line text field updates the value and restores grid navigation. Alphanumeric keys may begin editing directly. Tab and Shift+Tab move focus to the next or previous interactive element while using the grid. Space activates any associated control, such as checkboxes or buttons.
Selection *
Ctrl+Space, Shift+Space, Ctrl+A, Shift+Arrow keys
Select an entire column or row that currently contains focus using Ctrl+Space or Shift+Space, respectively. Ctrl+A selects all cells in the grid, while Shift+Arrow keys extend selection one cell to the right (Shift+Left), right (Shift+Right), up (Shift+Up), and down (Shift+down).
Entering and leaving the grid
Tab, Shift+Tab
Moves focus into or out of the grid. Only one focusable element, such as a cell, is included in the page sequence. If a cell was focused before leaving the grid, it regains focus when the user re-enters the grid.
* These behaviors are optional

Use these typical keyboard operations to plan grid navigation and cell interaction. section 6.2

On narrow screens or at high zoom, a grid may need horizontal scrolling. Contain that scrolling within the grid rather than making the whole page scroll in two dimensions; avoid shrinking text or columns to force a fit. section 6.2.1

How Architecting Accessibility covers it

How deep it goes
Defines table semantics, grid roles, and keyboard focus management; leaves interaction behavior to implement, test, and maintain.
Examples
Shows arrow-key cell movement, optional editing, and a data grid with selection and clipboard actions.
What you can do after
Build it from scratch with native table structure, grid semantics, and managed keyboard focus.
How it connects
Connects HTML tables and ARIA roles with keyboard navigation, focus management, and responsive layout.

Also explained in

Compare how 2 books explain data grid →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Architecting Accessibility. The section links point to the parts of the book it draws on.