Table
Tables are used to organize and display data efficiently. It renders a <table>
element by default.
Import#
import { Table, Thead, Tbody, Tr, Th, Td, TableCaption } from "@chakra-ui/react"
Table Variants#
The table component comes in 3 variants: simple, striped, and unstyled.
The default variant is simple
Change the
variantvalues to see the other variants.
Simple Table#
| To convert | into | multiply by |
|---|---|---|
| inches | millimetres (mm) | 25.4 |
| feet | centimetres (cm) | 30.48 |
| yards | metres (m) | 0.91444 |
Editable Example
Striped Table#
| To convert | into | multiply by |
|---|---|---|
| inches | millimetres (mm) | 25.4 |
| feet | centimetres (cm) | 30.48 |
| yards | metres (m) | 0.91444 |
Editable Example
Table Sizing#
The table component is available in 3 sizes: sm, md, lg. The default size
is md.
| To convert | into | multiply by |
|---|---|---|
| inches | millimetres (mm) | 25.4 |
| feet | centimetres (cm) | 30.48 |
| yards | metres (m) | 0.91444 |
Editable Example
Props#
Table#
| Name | Type | Description | Default |
|---|---|---|---|
| colorScheme | string | - | |
| size | string | - | |
| variant | string | - |
Td#
| Name | Type | Description | Default |
|---|---|---|---|
| isNumeric | boolean | Aligns the cell content to the right | - |
Th#
| Name | Type | Description | Default |
|---|---|---|---|
| isNumeric | boolean | Aligns the cell content to the right | - |
TableCaption#
| Name | Type | Description | Default |
|---|---|---|---|
| placement | "top" | "bottom" | The placement of the table caption. This sets the `caption-side` CSS attribute. | "bottom" |