Table
Table is used to display structured data in rows and columns.
Installation
npx jsx-daisyui add tableDefault
table-default
| # | Name | Role | Status |
|---|---|---|---|
| 1 | Alice Johnson | Admin | Active |
| 2 | Bob Martinez | Editor | Active |
| 3 | Carol White | Viewer | Inactive |
Zebra
table-zebra
| Name | Job | Favourite Color |
|---|---|---|
| Cy Ganderton | Quality Control | Blue |
| Hart Hagerty | Desktop Support | Purple |
| Brice Swyre | Tax Accountant | Red |
| Marjy Ferencz | Office Assistant | Crimson |
Sizes
table-sizes
xs
| Name | Role |
|---|---|
| Alice | Admin |
| Bob | Editor |
sm
| Name | Role |
|---|---|
| Alice | Admin |
| Bob | Editor |
md
| Name | Role |
|---|---|
| Alice | Admin |
| Bob | Editor |
lg
| Name | Role |
|---|---|
| Alice | Admin |
| Bob | Editor |
Bordered
table-bordered
| Product | Price | Stock |
|---|---|---|
| Widget A | $9.99 | In stock |
| Widget B | $14.99 | Low stock |
| Widget C | $4.99 | Out of stock |
Props
Table
| Prop | Type | Default | Description |
|---|---|---|---|
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'md' | The size of the table. |
zebra | boolean | - | Applies alternating background colors to rows. |
pinRows | boolean | - | Makes table headers sticky at the top. |
pinCols | boolean | - | Makes the first column sticky on the left. |
bordered | boolean | - | Adds a border around the table container. |
wrapperClassName | string | - | Custom classes applied to the div wrapper. |