Table
Tables display structured data in rows and columns using a compound component pattern.
Import
import { Table } from '@sigx/daisyui';
Basic Usage
Loading preview...
Active Row
Use the active prop on Table.Row to highlight a row.
Loading preview...
Hover Row
Use the hover prop on Table.Row to highlight rows on hover.
Loading preview...
Zebra Striping
Use the zebra prop to add alternating row backgrounds.
Loading preview...
With Footer
Use Table.Foot to add a footer section with pinned rows.
Loading preview...
Pinned Rows
Use pinRows to make header and footer rows sticky when scrolling vertically.
Loading preview...
Pinned Columns
Use pinCols to make <th> columns sticky when scrolling horizontally.
Loading preview...
Sizes
Available sizes: xs, sm, md (default), lg, and xl.
Loading preview...
With Actions
Loading preview...
Props
Table Props
| Prop | Type | Default | Description |
|---|---|---|---|
zebra | boolean | false | Alternate row background colors |
pinRows | boolean | false | Make header/footer rows sticky when scrolling vertically |
pinCols | boolean | false | Make <th> columns sticky when scrolling horizontally |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | — | Table size |
class | string | — | Additional CSS classes |
Table.Row Props
| Prop | Type | Default | Description |
|---|---|---|---|
hover | boolean | false | Highlight row on hover |
active | boolean | false | Highlight row as active |
class | string | — | Additional CSS classes |
Sub-Components
| Component | Description |
|---|---|
Table.Head | Table header section (<thead>) |
Table.Body | Table body section (<tbody>) |
Table.Foot | Table footer section (<tfoot>) |
Table.Row | Table row (<tr>) — supports hover and active props |
Table.Th | Table header cell (<th>) |
Table.Td | Table data cell (<td>) |