Responsive Table Test
Responsive tables collapse columns into expandable sections on narrow screens (and at high zoom settings) to eliminate the need for horizontal scrolling, for example:
- AEM Data Table Component
- ILogin ESAM Tables (requires sign in)
There is no specific ARIA Pattern for responsive tables, but consider:
and the following requirements:
- Expand/collapse (and sort) controls must be focusable
- Controls must be clickable by keyboard (space) and speech recognition
- Controls must have indication that they are clickable (screen reader and visual)
- Controls must have aria-expanded="true/false" (and sort="ascending/descending")
- Controls must be clickable even if the cell contains a link
- Controls should have adequate target size for mobile devices
- Controls shouldn't trigger screen reader forms mode unexpectedly
- Ideally, controls would not be read as part of headers with table reading commands
- Collapsed columns should be associated with their row header
- Do NOT use aria-owns -- it breaks VoiceOver
(Note: in the tests below, tables are already "collapsed" -- so we don't have to resize the browser to test.)
Original Table
Agency | Acronym | Code | Staff |
---|---|---|---|
Aging | AGE | 402 | 147 |
Agriculture | AGR | 406 | 355 |
Arts Council | IAC | 503 | 17 |
Test 1: Clickable Headers
Agency | Acronym | Code | Staff |
---|---|---|---|
Aging | AGE | 402 | 147 |
|
|||
Agriculture | AGR | 406 | 355 |
|
|||
Arts Council | IAC | 503 | 17 |
|
- Works with the keyboard, but
- Expanded state is not read for rowheader without link unless tabbing
- When tabbing, forms mode activates; must press escape to exit
- Clicking header with link activates link; must tab to get focus to column header
- VoiceOver never reads state and cannot get focus to column header
- Headers may not be clickable with speech recognition
Test 2: Buttons after Header Text
Agency | Acronym | Code | Staff |
---|---|---|---|
Aging | AGE | 402 | 147 |
|
|||
Agriculture | AGR | 406 | 355 |
|
|||
Arts Council | IAC | 503 | 17 |
|
- Works with keyboard, JAWS, NVDA & VoiceOver, but
- Repeats "expand" (and "sort") with table reading commands, excessively with VoiceOver
- Buttons all have the same aria-label, which may be a problem for speech recognition
Test 3: Buttons containing Header Text (except links)
Agency | Acronym | Code | Staff |
---|---|---|---|
AGE | 402 | 147 | |
|
|||
AGR | 406 | 355 | |
|
|||
Arts Council | IAC | 503 | 17 |
|
- Works with keyboard, JAWS, NVDA & VoiceOver without repeating "expand" and "sort" with table reading commands!
- Only (?) downside is that header text is read twice when header contains a link