Data tables
Data tables display sets of data across rows and columns.
Interactive demo
This demo lets you preview the data table component and its configuration options.
Usage
Data tables display information in a grid-like format of rows and columns. They organize information in a way that’s easy to scan so that users can look for patterns and develop insights from data.
Data tables can contain:
- Interactive components (such as chips, buttons, or menus)
- Non-interactive elements (such as badges)
- Tools to query and manipulate data
Principles

Organized
Information should be organized in a meaningful way, such as hierarchy or alphabetization.

Interactive
Data tables should allow user interaction so that a data display is customizable and interactive.

Intuitive
Data tables should be easy to use, with a logical structure that makes content easy to understand.
Anatomy

2. Rows
3. Pagination
4. Row checkbox
5. Sort button
6. Container
Data table elements
Baseline elements
Column header names describe the type of content displayed in each column. Each row contains data related to a single entity.
Interactive elements
Data tables can include interactive elements, such as:
- Checkboxes
- Sorting (on columns)
- Icons that communicate alerts
- Pagination
Pagination or filter chips: Controls that manipulate how table data is displayed should be placed directly above or below a table.

Columns
Height and padding
The baseline row height is 52dp, and the column header row height is 56dp (4dp taller than regular rows).

Padding
There is 32dp or more of padding between columns.

Text
Column header text uses a medium weight font to differentiate from row text.
Text that is longer than the column width is truncated with an ellipsis. On hover, a tooltip shows the full name.


Sorting
To help users sort information, column can be displayed sorting by default.
To indicate which column is sorted by default, place a downward or upward arrow icon next to the column header’s name.

Reversing sort order
To reverse the sort order of a column, a user taps the header name or arrow icon. Upon sorting, the arrow icon reverses direction.


Sorting with a progress indicator
A linear progress indicator is used in data tables when sorting is initiated. The progress indicator communicates to users that sorting is in process.

Row checkbox
When a row checkbox is selected, the row should display a background color.
For people who use screen magnification, the selected checkbox may appear outside of the magnified screen area. The addition of a background color fill provides an additional way to indicate that a row has been selected.
For more information on selection states, visit States.

Behavior
Row hover (Desktop)
When a user hovers over a row, that row displays a background color.

Column hover (Desktop)
When the user hovers over a column header:
- A tooltip can display the full column name (if it’s truncated) or a more detailed description of the column
- If sorting is enabled, an arrow icon can appear next to the column header

Focus
When using keyboard focus, an indicator appears as users tab through interactive items such as checkboxes.

Inline menus
Inline menus allow selection from a predefined set of menu items. They're embedded directly in a table cell.


Pagination
Pagination controls provide swift access to all pages while indicating that more pages exist.
Pagination controls display:
- Number of rows per page
- Total number of rows, including the range currently in view
- Left and right arrows for navigating pages
Placement
Pagination is placed at the bottom of a table.

Pagination menus show a predefined list of options for the quantity of rows to display.


Theming
Rally Material Theme
The Rally personal finance app’s data tables have been customized using Material Theming. The areas of customization include color, typography, and shape.

Color
Rally’s data tables use custom color on four elements: the container, table text, header text, and dividers.

| Element | Category | Attribute | Value |
|---|---|---|---|
| Container | Surface | Color Opacity | #3C3C46 100% |
| Table text | On Surface | Color Opacity | #FFFFFF 100% |
| Header text | On Surface | Color Opacity | #FFFFFF 60% |
| Divider | On Surface | Color Opacity | #FFFFFF 12% |
Typography
Rally’s data tables use custom typography for table text.

| Element | Category | Attribute | Value |
|---|---|---|---|
| Text | Body 2 | Typeface Font Size Case | Roboto Condensed Regular 14 Title case |
Shape
Rally’s data tables have custom corner shapes, with 0dp long cut corners.

| Element | Category | Attribute | Value |
|---|---|---|---|
| Container | Large component | Family Size | Cut 0;0;0;0dp |
Specs
Target area
The minimum touch target for interactive elements is 48 x 48 dp.

Element bounds
Targets can extend areas beyond the bounds of an element.

Table cell padding
Table cell padding is minimized to improve content density.

• Table cell left padding: 8dp
Corner radius
Data tables have a rectangular shape by default, with subtly rounded corners.

Elevation
Data tables don’t express elevation as they're often in front of solid color backgrounds. They also don’t move in front of or behind other surfaces.

Container outline
An outline can separate a table from either another table or other components.

Height and padding

• Row height: 52dp (4dp shorter than the header row)
• Padding: 16dp
• Container dimensions expand to fit content
Numeric alignment
Align numbers to the right for improved scannability.
