Table

A robust set of components for building responsive, accessible, and customizable data tables. Includes support for sorting, resizing, pagination, borders, and more.

Table

Use the table primitives to compose standard HTML tables with built-in styling.

Name
Title
Email
John Doe Frontend Engineer john@example.com
Jane Smith Product Manager jane@example.com

Advanced Table Features

Tables can include resizable columns, sortable headers, sticky states, nested UI components (avatars, tags, buttons), and tree structures.

Employee
Status
Role
Actions
Alice Cooper alice@company.com
Active Designer
Bob Builder bob@company.com
On Leave Junior Designer
Charlie Davis charlie@company.com
Offline Developer
Showing 1 to 3 of 24 results

Client-side Sorting

Add sortable and sortDirection to TableHeadCell to enable click-to-sort functionality. The table includes automatic string and numeric sorting client-side out-of-the-box.

Name
Age
Role
Alice Smith 28 Engineer
Charlie Brown 42 Manager
Bob Jones 35 Designer

Client-side Filtering

Use an external or nested input field equipped with data-filter-table="true" and data-filter-col="index" to instantly filter row contents based on column matches.

ID
User
Email
1 Alice Smith alice@smith.com
2 Bob Jones bob@jones.com
3 Charlie Brown charlie@brown.com

Resizing Columns

Add resizable to TableHeadCell to render a drag handle on the right edge of the header, allowing horizontal column adjustment. Note: This requires fixed table layouts (`table-fixed`).

Company
Contact
Country
Acme Corp John Doe USA
Globex Jane Smith UK

Drag and Drop Columns

Add draggable to TableHeadCell to enable dragging columns left/right. The table script automatically manages column DOM shifts.

ID
Product
Price
001 Laptop $999
002 Phone $599

Row Grouping

Tables can group rows together. Use data-group-header="true", data-group-id, and aria-expanded on the header row, and data-group="id" on the child rows. The component includes built-in client-side toggle logic.

Team Member
Role
Status
Engineering (2)
Alice Smith Frontend Developer Active
Bob Jones Backend Developer Active

Table

Tables can contain complex interactive elements like form inputs, allowing inline editing.

Product
Category
Price
Stock

Table

Tables can be configured with sortable columns, draggable columns, and resizable columns.

Name
Age
Location
Alice 28 New York
Bob 34 San Francisco
Charlie 22 London

Table

Tables can easily integrate with the Pagination component for handling large datasets.

ID
User
Role
001 John Doe Admin
002 Jane Smith User

API Reference

Table

Property
Description
Type
Default

size

Table size preset 'sm' | 'md' | 'lg' 'md'

striped

Applies striped row styling boolean false

bordered

Applies a border to the table container boolean true

maxHeight

Applies a max-height (500px) and enables scrolling boolean false

containerClass

Custom classes for the table container string ''

TableCell

Property
Description
Type
Default

align

Text alignment for the cell 'left' | 'center' | 'right' 'left'

padding

Padding reset for custom contents 'default' | 'none' 'default'

TableHeadCell

Property
Description
Type
Default

sticky

Makes the header cell sticky boolean false

sortable

Enables column sorting boolean false

resizable

Enables column resizing boolean false

draggable

Enables column drag and drop reordering boolean false