Table
Render table with theme styles
Import
Source
Docs
Package
Usage
Table data for all examples:
| Element position | Element name | Symbol | Atomic mass | 
|---|---|---|---|
| 6 | Carbon | C | 12.011 | 
| 7 | Nitrogen | N | 14.007 | 
| 39 | Yttrium | Y | 88.906 | 
| 56 | Barium | Ba | 137.33 | 
| 58 | Cerium | Ce | 140.12 | 
Spacing
To control spacing use horizontalSpacing and verticalSpacing props. Both props support spacing from theme.spacing and any valid CSS value to set cell padding:
| Position | Name | Symbol | Mass | 
|---|---|---|---|
| 6 | Carbon | C | 12.011 | 
| 7 | Nitrogen | N | 14.007 | 
| 39 | Yttrium | Y | 88.906 | 
| 56 | Barium | Ba | 137.33 | 
| 58 | Cerium | Ce | 140.12 | 
HorizontalSpacing
xs
sm
md
lg
xl
VerticalSpacing
xs
sm
md
lg
xl
FontSize
xs
sm
md
lg
xl
Caption and tfoot
Table support tfoot and caption elements. Set captionSide prop (top or bottom) to change caption position.
| Element position | Element name | Symbol | Atomic mass | 
|---|---|---|---|
| 6 | Carbon | C | 12.011 | 
| 7 | Nitrogen | N | 14.007 | 
| 39 | Yttrium | Y | 88.906 | 
| 56 | Barium | Ba | 137.33 | 
| 58 | Cerium | Ce | 140.12 | 
| Element position | Element name | Symbol | Atomic mass | 
Striped and rows hover
| Element position | Element name | Symbol | Atomic mass | 
|---|---|---|---|
| 6 | Carbon | C | 12.011 | 
| 7 | Nitrogen | N | 14.007 | 
| 39 | Yttrium | Y | 88.906 | 
| 56 | Barium | Ba | 137.33 | 
| 58 | Cerium | Ce | 140.12 | 
Table component props
| Name | Type | Description | 
|---|---|---|
| captionSide | "bottom" | "top" | Table caption position | 
| fontSize | number | "xs" | "sm" | "md" | "lg" | "xl" | Sets font size of all text inside table | 
| highlightOnHover | boolean | If true row will have hover color | 
| horizontalSpacing | number | "xs" | "sm" | "md" | "lg" | "xl" | Horizontal cells spacing from theme.spacing or any valid CSS value | 
| striped | boolean | If true every odd row of table will have gray background color | 
| verticalSpacing | number | "xs" | "sm" | "md" | "lg" | "xl" | Vertical cells spacing from theme.spacing or any valid CSS value | 
| withBorder | boolean | Add border to table | 
| withColumnBorders | boolean | Add border to columns |