| # | Required | Element | Description |
|---|---|---|---|
| 1 | Container | The root table element. Wraps all rows and cells. | |
| 2 | Column header | Labels each column. Can be made clickable. | |
| 3 | Row | A single data set entry. |
The Table is a component used to display sets of data in an organized, tabular format. Compared to our DataTable component, it's less opinionated and custom, but more than suitable for basic data sets.
Historically, HTML tables were once used to arrange elements on a webpage before modern CSS layout tools like Flexbox and Grid existed. Never use the Table for layout purposes. We provide components specialized in building layouts such as the Box and Grid. For more information and the full list of available components, see our "Layout" section under "Components."
The Table and DataTable components are very similar but play a different role in how the user interacts with the data displayed:
Layout determines how the Table distributes column widths. The default auto layout allows columns to adjust to content size. Fixed layout divides columns equally regardless of content, providing predictable sizing.
| Product | Category | Price |
|---|---|---|
| Ceramic vase | Home | $45 |
| Leather journal | Office | $28 |
| Cotton blanket | Home | $62 |
Columns adjust to fit their content. This behavior is default and is suitable for most Tables.
| Product | Category | Price |
|---|---|---|
| Ceramic vase | Home | $45 |
| Leather journal | Office | $28 |
| Cotton blanket | Home | $62 |
Columns are divided equally regardless of content size. Use for predictable Table sizing when all columns carry similar amounts of data.
Beyond the default bordered rows, the Table supports striped and borderless styles.
Borderless rows remove the separator between entries for a cleaner presentation. Striped rows alternate between two background colors to improve readability in data-dense Tables.
| Product | Category | Price |
|---|---|---|
| Ceramic vase | Home | $45 |
| Leather journal | Office | $28 |
| Cotton blanket | Home | $62 |
Rows have a consistent background with a border separating each entry. Suitable for most use cases.
| Product | Category | Price |
|---|---|---|
| Ceramic vase | Home | $45 |
| Leather journal | Office | $28 |
| Cotton blanket | Home | $62 |
Borders between rows are removed for a cleaner visual presentation. Best suited for smaller datasets.
| Product | Category | Price |
|---|---|---|
| Ceramic vase | Home | $45 |
| Leather journal | Office | $28 |
| Cotton blanket | Home | $62 |
Alternating background colors improve readability for Tables with many rows of similarly structured data.
| Product | Category | Price |
|---|---|---|
| Ceramic vase | Home | $45 |
| Leather journal | Office | $28 |
| Cotton blanket | Home | $62 |
The default resting state displays data with bordered rows and a subtle header background.
| Ceramic vase | Home | $45 |
| Leather journal | Office | $28 |
Clickable column headers change background color and text color on hover to indicate they can be activated.
| Product | Category | Price |
|---|---|---|
| Ceramic vase | Home | $45 |
| Leather journal | Office | $28 |
| Cotton blanket | Home | $62 |
When hover highlighting is enabled, rows change background color on mouse hover to indicate interactivity.
| Ceramic vase | Home | $45 |
| Leather journal | Office | $28 |
Focused headers receive the standard 2px light blue outline.
| Ceramic vase | Home | $45 |
| Leather journal | Office | $28 |
The active state highlights a column header in the accent color, typically used to indicate the current sort column.
Table cells support depth-based padding for tree-like or nested table patterns. When enabled on a cell, additional inline-start padding is calculated based on a nesting level, visually indenting child rows to convey hierarchy.
| Category | Items | Revenue |
|---|---|---|
| Electronics | 150 | $45,000 |
| Smartphones | 89 | $32,000 |
| Laptops | 61 | $13,000 |
| Furniture | 203 | $28,500 |
Child rows are indented with padding based on a prop on the first cell and the depth prop on the row.
When a Table is placed inside a Panel, edge cells (first and last in each row) automatically inherit the Panel's content padding. This ensures that Table content aligns flush with the Panel's borders without manual padding adjustments.
| Product | Category | Price |
|---|---|---|
| Ceramic vase | Home | $45 |
| Leather journal | Office | $28 |
| Cotton blanket | Home | $62 |
Edge cells align with the Panel's content area for a cohesive layout.
Table captions are important for providing assistive technology information about the Table's purpose and the type of data it contains. Short, descriptive nouns or noun phrases work best for captions.
Column headers should clearly label the data in each column. Write headers in sentence case and avoid abbreviations where possible.
| Product name | Category | Unit price |
|---|---|---|
| Ceramic vase | Home | $45 |
| Prod nm | Cat | UP |
|---|---|---|
| Ceramic vase | Home | $45 |