Skip to Content

Table

A data display component designed to structure structured, multi-column datasets inside rows and cells. 

#HeaderHeaderHeader
1Cell 1Cell 2Cell 3
2Cell 4Cell 5Cell 6

Striped Rows

Use the table-striped or table-striped-even class to enable striped rows.

#HeaderHeaderHeader
1Cell 1Cell 2Cell 3
2Cell 4Cell 5Cell 6
3Cell 7Cell 8Cell 9

Striped Columns

Use the table-striped-columns or table-striped-columns-odd class to enable striped columns.

#HeaderHeaderHeader
1Cell 1Cell 2Cell 3
2Cell 4Cell 5Cell 6
3Cell 7Cell 8Cell 9

Bordered Table

#HeaderHeaderHeader
1Cell 1Cell 2Cell 3
2Cell 4Cell 5Cell 6

Column Bordered Table

#HeaderHeaderHeader
1Cell 1Cell 2Cell 3
2Cell 4Cell 5Cell 6

Full Bordered Table

#HeaderHeaderHeader
1Cell 1Cell 2Cell 3
2Cell 4Cell 5Cell 6

Borderless Table

#HeaderHeaderHeader
1Cell 1Cell 2Cell 3
2Cell 4Cell 5Cell 6

Interactive Table

Use the interactive class to enable interaction with the table. Refer to the Interaction section for more information on interactive variants.

#HeaderHeaderHeader
1Cell 1Cell 2Cell 3
2Cell 4Cell 5Cell 6

Sizes

Use the table-{size} class to control the component size.

Size values can include:smmd.

For more information on all available sizing utilities, visit Tailwind 

#HeaderHeaderHeader
1Cell 1Cell 2Cell 3
2Cell 4Cell 5Cell 6
#HeaderHeaderHeader
1Cell 1Cell 2Cell 3
2Cell 4Cell 5Cell 6

Variants

Use the variant and palette classes to control the appereance of the component.

Variant values can include solidoutlinesubtlelinkplain.
Color palettes can include primaryneutral. For extra palettes such as warning error and more, refer to the Colors section.

Header
Cell
Header
Cell
Header
Cell
Header
Cell
Header
Cell
Header
Cell
Header
Cell
Header
Cell

Customizing

globals.css
:root { --ex-table-font-size-sm: var(--text-xs); --ex-table-font-size-md: var(--text-sm); --ex-table-striped-order: odd; --ex-table-striped-columns-order: even; --ex-table-cell-px-sm: calc(var(--spacing) * 3); --ex-table-cell-px-md: calc(var(--spacing) * 4); --ex-table-cell-py-sm: calc(var(--spacing) * 3); --ex-table-cell-py-md: calc(var(--spacing) * 4); --ex-table-caption-font-size-sm: var(--text-2xs); --ex-table-caption-font-size-md: var(--text-xs); --ex-table-caption-font-weight: var(--font-weight-normal); --ex-table-caption-opacity: var(--ex-options-opacity-muted); --ex-table-header-font-weight: var(--font-weight-normal); }

API

Table

ElementSelector
Table.ex-table
PropTypeDefault
asElementTypetable
asChildbooleanfalse

Table Caption

ElementSelector
Table.Caption.ex-table-caption
PropTypeDefault
asElementTypecaption
asChildbooleanfalse

Table Head

ElementSelector
Table.Head.ex-table-head
PropTypeDefault
asElementTypethead
asChildbooleanfalse

Table Body

ElementSelector
Table.Body.ex-table-body
PropTypeDefault
asElementTypetbody
asChildbooleanfalse

Table Foot

ElementSelector
Table.Foot.ex-table-foot
PropTypeDefault
asElementTypetfoot
asChildbooleanfalse

Table Header

ElementSelector
Table.Header.ex-table-header
PropTypeDefault
asElementTypeth
asChildbooleanfalse

Table Row

ElementSelector
Table.Row.ex-table-row
PropTypeDefault
asElementTypetr
asChildbooleanfalse

Table Cell

ElementSelector
Table.Cell.ex-table-cell
PropTypeDefault
asElementTypetd
asChildbooleanfalse
Last updated on