Description
- A table structures the display of data using a header, rows, and columns.
- It allows user to compare structured data using features like sorting and filtering.
Anatomy
Anatomy
Size
- Expand table cells over several columns (colspan) or several rows (rowspan) if needed.
- Use padding options in any table cell to adjust the row height.
| Size | Padding (left/right) | Font size | Row height |
|---|---|---|---|
| Extra small | 8 pixels | 14 pixels | 24 pixels |
| Small | 16 pixels | 14 pixels | 32 pixels |
| Medium (default) | 16 pixels | 14 pixels | 40 pixels |
| Large | 16 pixels | 16 pixels | 48 pixels |
| Extra large | 16 pixels | 16 pixels | 64 pixels |
Header
Header style
- Create a visually distinct table header by:
- adjusting the size of the cell borders in a row.
- adjusting the background color of the cells in a row.
- Lock a table header to make it sticky and always visible when a user scrolls vertically.
- A header row cannot be selected, dragged, expanded, or include a checkbox, but it may support column sorting. For filtering, a separate component should be used outside of the table, like in the Example section at the bottom of the page.
Subtle default
Subtle with alternate header
Prominent default
Prominent with alternate header
Sorting with headers
The sorting header variant allows users to sort a table's data by a particular column.
For more complex use cases which require additional options and control, see the filtering pattern.
Sortable table
Sort states
Visual affordance
Columns
Lock one or more table columns to make them sticky and always visible when a user scrolls horizontally.
Column locking
Column types
Standard
Sticky column(s) on the left
Sticky column on the right
Custom border thickness - column
Column scroll
Horizontal scroll
Rows
The bottom row will always have rounded outer bottom corners to form the overall shape of the table.
Changing the cells from a footer row to another type of row should not affect this shape.
Row types
Standard
Button
Button action popover
Draggable
Expandable
Link
Pill
Selectable
Zebra
Footer
Custom border thickness - row
Row scroll
Vertical scroll
Row states
Default
Selected
Dragging
Expandable collapsed
Expanded - 1 child level
Expanded - 3 child levels (max)
Variations
Vertical dividers
Without table border
Sorting header
Pagination
Footer row
Examples
Search with no results
Zebra cells
Best practices
- Use a table to display data designed for data grids.
- For links in tables, follow the guidance in the Link component where possible.
- Balance complexity and user context when making design decisions.
- For example, in a financial reporting table where positive and negative numbers are linked to nominal activity reports, you could use negative links (red) for negative numbers, and standard links (green) for positive numbers.
Dos and don'ts
Do
Do
Do
Do
Do