table component
Drop-in semantic component. See examples, sizes, variants, and source.
Data table built on a native <table class="table">
wrapped in a table-wrapper for horizontal scroll
and outer chrome. Layer in bordered,
striped, compact, or
spacious for density; use cell modifiers like
cell-numeric, cell-actions,
and cell-checkbox for typed columns.
Table System
Basic Table
Name
Position
Office
Age
Salary
John Doe
Software Engineer
San Francisco
28
$120,000
Jane Smith
Product Manager
New York
32
$145,000
Mike Johnson
UX Designer
Los Angeles
26
$95,000
Sarah Williams
Data Analyst
Chicago
29
$85,000
<div class="table-wrapper">
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th class="text-right">Salary</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>28</td>
<td class="cell-numeric">$120,000</td>
</tr>
<tr>
<td>Jane Smith</td>
<td>Product Manager</td>
<td>New York</td>
<td>32</td>
<td class="cell-numeric">$145,000</td>
</tr>
<tr>
<td>Mike Johnson</td>
<td>UX Designer</td>
<td>Los Angeles</td>
<td>26</td>
<td class="cell-numeric">$95,000</td>
</tr>
<tr>
<td>Sarah Williams</td>
<td>Data Analyst</td>
<td>Chicago</td>
<td>29</td>
<td class="cell-numeric">$85,000</td>
</tr>
</tbody>
</table>
</div>
Sortable Table
Product
Category
Price
Stock
Status
MacBook Pro
Laptops
$2,499
12
Available
iPhone 15
Phones
$999
45
Available
iPad Air
Tablets
$599
0
Out of Stock
AirPods Pro
Accessories
$249
8
Low Stock
<div class="table-wrapper">
<table class="table">
<thead>
<tr>
<th class="sortable">Product</th>
<th class="sortable">Category</th>
<th class="sortable" data-type="numeric">Price</th>
<th class="sortable" data-type="numeric">Stock</th>
<th class="sortable">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>MacBook Pro</td>
<td>Laptops</td>
<td class="cell-numeric" data-sort="2499">$2,499</td>
<td class="cell-numeric">12</td>
<td><span class="badge positive">Available</span></td>
</tr>
<tr>
<td>iPhone 15</td>
<td>Phones</td>
<td class="cell-numeric" data-sort="999">$999</td>
<td class="cell-numeric">45</td>
<td><span class="badge positive">Available</span></td>
</tr>
<tr>
<td>iPad Air</td>
<td>Tablets</td>
<td class="cell-numeric" data-sort="599">$599</td>
<td class="cell-numeric">0</td>
<td><span class="badge negative">Out of Stock</span></td>
</tr>
<tr>
<td>AirPods Pro</td>
<td>Accessories</td>
<td class="cell-numeric" data-sort="249">$249</td>
<td class="cell-numeric">8</td>
<td><span class="badge warning">Low Stock</span></td>
</tr>
</tbody>
</table>
</div>
Selectable Table with Actions
<div class="stack compact">
<div class="selection-count text-sm text-gray-600 font-medium"></div>
<div class="table-wrapper">
<table class="table">
<thead>
<tr>
<th class="cell-checkbox">
<input type="checkbox" class="rounded border-gray-300" />
</th>
<th>User</th>
<th>Email</th>
<th>Role</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td class="cell-checkbox">
<input type="checkbox" class="rounded border-gray-300" />
</td>
<td>Alice Johnson</td>
<td>alice@example.com</td>
<td>Admin</td>
<td><span class="badge positive">Active</span></td>
<td class="cell-actions">
<button class="button xs">Edit</button>
<button class="button xs outline">Delete</button>
</td>
</tr>
<tr>
<td class="cell-checkbox">
<input type="checkbox" class="rounded border-gray-300" />
</td>
<td>Bob Smith</td>
<td>bob@example.com</td>
<td>Editor</td>
<td><span class="badge positive">Active</span></td>
<td class="cell-actions">
<button class="button xs">Edit</button>
<button class="button xs outline">Delete</button>
</td>
</tr>
<tr>
<td class="cell-checkbox">
<input type="checkbox" class="rounded border-gray-300" />
</td>
<td>Charlie Brown</td>
<td>charlie@example.com</td>
<td>Viewer</td>
<td><span class="badge gray">Inactive</span></td>
<td class="cell-actions">
<button class="button xs">Edit</button>
<button class="button xs outline">Delete</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
Rich Cell Types
<div class="table-wrapper">
<table class="table">
<thead>
<tr>
<th>Feature</th>
<th>Progress</th>
<th>Rating</th>
<th>Toggle</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>Dashboard Redesign</td>
<td class="cell-progress">
<div class="progress">
<div class="progress-bar" style="width: 75%"></div>
</div>
<span class="text-xs text-gray-600 ml-2">75%</span>
</td>
<td class="cell-rating">
<div class="rating sm">
<i class="star active"></i>
<i class="star active"></i>
<i class="star active"></i>
<i class="star active"></i>
<i class="star"></i>
</div>
</td>
<td class="cell-toggle">
<label class="switch sm">
<input type="checkbox" checked />
<span class="track"><span class="thumb"></span></span>
</label>
</td>
<td><span class="badge primary">In Progress</span></td>
</tr>
<tr>
<td>API Integration</td>
<td class="cell-progress">
<div class="progress">
<div class="progress-bar bg-green-500" style="width: 100%"></div>
</div>
<span class="text-xs text-gray-600 ml-2">100%</span>
</td>
<td class="cell-rating">
<div class="rating sm">
<i class="star active"></i>
<i class="star active"></i>
<i class="star active"></i>
<i class="star active"></i>
<i class="star active"></i>
</div>
</td>
<td class="cell-toggle">
<label class="switch sm">
<input type="checkbox" checked />
<span class="track"><span class="thumb"></span></span>
</label>
</td>
<td><span class="badge positive">Complete</span></td>
</tr>
<tr>
<td>Mobile App</td>
<td class="cell-progress">
<div class="progress">
<div class="progress-bar bg-yellow-500" style="width: 30%"></div>
</div>
<span class="text-xs text-gray-600 ml-2">30%</span>
</td>
<td class="cell-rating">
<div class="rating sm">
<i class="star active"></i>
<i class="star active"></i>
<i class="star"></i>
<i class="star"></i>
<i class="star"></i>
</div>
</td>
<td class="cell-toggle">
<label class="switch sm">
<input type="checkbox" />
<span class="slider"></span>
</label>
</td>
<td><span class="badge warning">Pending</span></td>
</tr>
</tbody>
</table>
</div>
Table Size Variants
Tiny
Name
Role
Status
John Doe
Admin
Active
Jane Smith
User
Active
Small
Name
Role
Status
John Doe
Admin
Active
Jane Smith
User
Active
Default
Name
Role
Status
John Doe
Admin
Active
Jane Smith
User
Active
Large
Name
Role
Status
John Doe
Admin
Active
Jane Smith
User
Active
Big
Name
Role
Status
John Doe
Admin
Active
Jane Smith
User
Active
<div class="stack">
<div>
<h4 class="subhead-semibold text-gray-700 mb-2">Tiny</h4>
<div class="table-wrapper">
<table class="table xs">
<thead>
<tr>
<th>Name</th>
<th>Role</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>Admin</td>
<td><span class="badge xs positive">Active</span></td>
</tr>
<tr>
<td>Jane Smith</td>
<td>User</td>
<td><span class="badge xs positive">Active</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<h4 class="subhead-semibold text-gray-700 mb-2">Small</h4>
<div class="table-wrapper">
<table class="table sm">
<thead>
<tr>
<th>Name</th>
<th>Role</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>Admin</td>
<td><span class="badge sm positive">Active</span></td>
</tr>
<tr>
<td>Jane Smith</td>
<td>User</td>
<td><span class="badge sm positive">Active</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<h4 class="subhead-semibold text-gray-700 mb-2">Default</h4>
<div class="table-wrapper">
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Role</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>Admin</td>
<td><span class="badge positive">Active</span></td>
</tr>
<tr>
<td>Jane Smith</td>
<td>User</td>
<td><span class="badge positive">Active</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<h4 class="subhead-semibold text-gray-700 mb-2">Large</h4>
<div class="table-wrapper">
<table class="table xl">
<thead>
<tr>
<th>Name</th>
<th>Role</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>Admin</td>
<td><span class="badge xl positive">Active</span></td>
</tr>
<tr>
<td>Jane Smith</td>
<td>User</td>
<td><span class="badge xl positive">Active</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<h4 class="subhead-semibold text-gray-700 mb-2">Big</h4>
<div class="table-wrapper">
<table class="table lg">
<thead>
<tr>
<th>Name</th>
<th>Role</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>John Doe</td>
<td>Admin</td>
<td><span class="badge lg positive">Active</span></td>
</tr>
<tr>
<td>Jane Smith</td>
<td>User</td>
<td><span class="badge lg positive">Active</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
Table Style Variants
Bordered
Product
Price
Quantity
Widget A
$19.99
100
Widget B
$29.99
50
Striped
Product
Price
Quantity
Widget A
$19.99
100
Widget B
$29.99
50
Widget C
$39.99
25
Widget D
$49.99
10
Compact
Product
Price
Quantity
Widget A
$19.99
100
Widget B
$29.99
50
Spacious
Product
Price
Quantity
Widget A
$19.99
100
Widget B
$29.99
50
<div class="space-y-6">
<div>
<h4 class="subhead-semibold text-gray-700 mb-2">Bordered</h4>
<div class="table-wrapper">
<table class="table bordered">
<thead>
<tr>
<th>Product</th>
<th>Price</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<tr>
<td>Widget A</td>
<td class="cell-numeric">$19.99</td>
<td class="cell-numeric">100</td>
</tr>
<tr>
<td>Widget B</td>
<td class="cell-numeric">$29.99</td>
<td class="cell-numeric">50</td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<h4 class="subhead-semibold text-gray-700 mb-2">Striped</h4>
<div class="table-wrapper">
<table class="table striped">
<thead>
<tr>
<th>Product</th>
<th>Price</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<tr>
<td>Widget A</td>
<td class="cell-numeric">$19.99</td>
<td class="cell-numeric">100</td>
</tr>
<tr>
<td>Widget B</td>
<td class="cell-numeric">$29.99</td>
<td class="cell-numeric">50</td>
</tr>
<tr>
<td>Widget C</td>
<td class="cell-numeric">$39.99</td>
<td class="cell-numeric">25</td>
</tr>
<tr>
<td>Widget D</td>
<td class="cell-numeric">$49.99</td>
<td class="cell-numeric">10</td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<h4 class="subhead-semibold text-gray-700 mb-2">Compact</h4>
<div class="table-wrapper">
<table class="table compact">
<thead>
<tr>
<th>Product</th>
<th>Price</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<tr>
<td>Widget A</td>
<td class="cell-numeric">$19.99</td>
<td class="cell-numeric">100</td>
</tr>
<tr>
<td>Widget B</td>
<td class="cell-numeric">$29.99</td>
<td class="cell-numeric">50</td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<h4 class="subhead-semibold text-gray-700 mb-2">Spacious</h4>
<div class="table-wrapper">
<table class="table spacious">
<thead>
<tr>
<th>Product</th>
<th>Price</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<tr>
<td>Widget A</td>
<td class="cell-numeric">$19.99</td>
<td class="cell-numeric">100</td>
</tr>
<tr>
<td>Widget B</td>
<td class="cell-numeric">$29.99</td>
<td class="cell-numeric">50</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
Table with Pagination
Order ID
Customer
Date
Total
Status
#001234
Alice Johnson
2024-01-15
$250.00
Delivered
#001235
Bob Smith
2024-01-16
$125.50
Shipped
#001236
Charlie Brown
2024-01-17
$450.00
Processing
#001237
Diana Prince
2024-01-18
$75.25
Delivered
#001238
Edward Norton
2024-01-19
$320.00
Cancelled
<div class="table-wrapper">
<table class="table" id="paginated-table">
<thead>
<tr>
<th>Order ID</th>
<th>Customer</th>
<th>Date</th>
<th>Total</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>#001234</td>
<td>Alice Johnson</td>
<td>2024-01-15</td>
<td class="cell-numeric">$250.00</td>
<td><span class="badge positive">Delivered</span></td>
</tr>
<tr>
<td>#001235</td>
<td>Bob Smith</td>
<td>2024-01-16</td>
<td class="cell-numeric">$125.50</td>
<td><span class="badge primary">Shipped</span></td>
</tr>
<tr>
<td>#001236</td>
<td>Charlie Brown</td>
<td>2024-01-17</td>
<td class="cell-numeric">$450.00</td>
<td><span class="badge warning">Processing</span></td>
</tr>
<tr>
<td>#001237</td>
<td>Diana Prince</td>
<td>2024-01-18</td>
<td class="cell-numeric">$75.25</td>
<td><span class="badge positive">Delivered</span></td>
</tr>
<tr>
<td>#001238</td>
<td>Edward Norton</td>
<td>2024-01-19</td>
<td class="cell-numeric">$320.00</td>
<td><span class="badge negative">Cancelled</span></td>
</tr>
</tbody>
</table>
<div class="table-pagination">
<div class="info">Showing 1 to 5 of 25 entries</div>
<div class="controls">
<button class="button" disabled>Previous</button>
<button class="button active" data-page="1">1</button>
<button class="button" data-page="2">2</button>
<button class="button" data-page="3">3</button>
<button class="button" data-page="4">4</button>
<button class="button" data-page="5">5</button>
<button class="button" data-page="2">Next</button>
</div>
</div>
</div>
Color Variants
Primary
Feature
Status
Feature A
Active
Feature B
Pending
Positive
Test
Result
Unit Tests
Passed
Integration Tests
Passed
Warning
Resource
Usage
CPU
85%
Memory
78%
<div class="stack">
<div>
<h4 class="subhead-semibold text-gray-700 mb-2">Primary</h4>
<div class="table-wrapper">
<table class="table primary">
<thead>
<tr>
<th>Feature</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr class="selected">
<td>Feature A</td>
<td><span class="badge primary">Active</span></td>
</tr>
<tr>
<td>Feature B</td>
<td><span class="badge">Pending</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<h4 class="subhead-semibold text-gray-700 mb-2">Positive</h4>
<div class="table-wrapper">
<table class="table positive">
<thead>
<tr>
<th>Test</th>
<th>Result</th>
</tr>
</thead>
<tbody>
<tr class="selected">
<td>Unit Tests</td>
<td><span class="badge positive">Passed</span></td>
</tr>
<tr>
<td>Integration Tests</td>
<td><span class="badge positive">Passed</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<h4 class="subhead-semibold text-gray-700 mb-2">Warning</h4>
<div class="table-wrapper">
<table class="table warning">
<thead>
<tr>
<th>Resource</th>
<th>Usage</th>
</tr>
</thead>
<tbody>
<tr class="selected">
<td>CPU</td>
<td><span class="badge warning">85%</span></td>
</tr>
<tr>
<td>Memory</td>
<td><span class="badge warning">78%</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
Empty State
Name
Email
Role
Status
No data available
There are no records to display at this time.
<div class="table-wrapper">
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Role</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="4" class="table-empty">
<svg class="icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"
></path>
</svg>
<div class="title">No data available</div>
<div class="description">There are no records to display at this time.</div>
</td>
</tr>
</tbody>
</table>
</div>
Responsive Table
This table stacks on mobile devices. Resize your browser to see the effect.
Product
Category
Price
Stock
MacBook Pro
Laptops
$2,499
12
iPhone 15
Phones
$999
45
iPad Air
Tablets
$599
0
<p class="subhead text-gray-600 mb-3">
This table stacks on mobile devices. Resize your browser to see the effect.
</p>
<div class="table-wrapper">
<table class="table responsive">
<thead>
<tr>
<th>Product</th>
<th>Category</th>
<th>Price</th>
<th>Stock</th>
</tr>
</thead>
<tbody>
<tr>
<td data-label="Product">MacBook Pro</td>
<td data-label="Category">Laptops</td>
<td data-label="Price" class="cell-numeric">$2,499</td>
<td data-label="Stock" class="cell-numeric">12</td>
</tr>
<tr>
<td data-label="Product">iPhone 15</td>
<td data-label="Category">Phones</td>
<td data-label="Price" class="cell-numeric">$999</td>
<td data-label="Stock" class="cell-numeric">45</td>
</tr>
<tr>
<td data-label="Product">iPad Air</td>
<td data-label="Category">Tablets</td>
<td data-label="Price" class="cell-numeric">$599</td>
<td data-label="Stock" class="cell-numeric">0</td>
</tr>
</tbody>
</table>
</div>
Class API Reference
Type
Class
Usage
Notes
Base
table
Required base class on the <table>
Always required
table-wrapper
Outer container — owns border, rounded corners, horizontal scroll
Always wrap your table in this
Sizes
xs
Tiny cell padding
Modifier on table
sm
Small cell padding
Modifier on table
(default)
Medium cell padding
No size class needed
xl
Large cell padding
Modifier on table
lg
Big cell padding
Modifier on table
Variants
bordered
Borders on every cell
Modifier on table
striped
Zebra-striped rows
Modifier on table
compact
Tighter padding than sm
Modifier on table
spacious
Roomier padding than default
Modifier on table
responsive
Stacks rows on mobile
Add data-label on each <td>
fixed-header
Sticky header on scroll
Modifier on table
Intents
primary
Blue header + selected row
Modifier on table
positive
Green header + selected row
Modifier on table
negative
Red header + selected row
Modifier on table
warning
Yellow header + selected row
Modifier on table
info
Blue header + selected row (lighter)
Modifier on table
Cells & Rows
sortable
Header is sortable, shows arrow
Add data-type="numeric" for numeric sort
selected
Highlights a row
Modifier on <tr>
cell-numeric
Right-align + tabular numbers
Modifier on <td> / <th>
cell-actions
Right-aligned action buttons
Modifier on <td>
cell-checkbox
Narrow checkbox column
Modifier on <td>
cell-progress / cell-rating / cell-toggle / cell-badge / cell-button
Vertical-padding tweaks for typed cells
Modifier on <td>
cell-truncate
Caps width and truncates with …
Modifier on <td>
cell-wrap
Allow text wrap inside the cell
Modifier on <td>
table-empty
Empty-state placeholder cell
Use colspan across the table
States
loading
Dim + disable interactions
Modifier on table
Wrapper
table-pagination
Pagination footer with info + page buttons
Holds info and controls children