<thead> and <tbody> elements. Wrap your table in a .table container to enable horizontal scrolling on small screens.
Basic Table
Features
Responsive Scrolling
The
.table wrapper enables horizontal scrolling on screens smaller than 320pxHover States
Rows automatically highlight on hover with a subtle background color transition
Semantic Structure
Uses proper
<thead>, <tbody>, <th>, and <td> elements for accessibilityAuto-styled
No classes needed on table elements - styling is automatic
Styling Details
Header Styling
Header Styling
- Text aligned to start (left in LTR languages)
- Medium font weight
- Muted foreground color
- Bottom border separator
- Padding:
var(--space-3)vertical,var(--space-2)horizontal
Body Styling
Body Styling
- Row hover effect with muted background
- Border between rows (except last row)
- Smooth transition for hover states
- Automatic word wrapping for long content
- Font size:
var(--text-7)
Responsive Behavior
Responsive Behavior
- Minimum width of 320px
- Full width by default
- Horizontal scroll when content overflows
- Border collapse for clean borders
Accessibility
- Uses semantic HTML table elements
- Proper
<thead>and<tbody>structure for screen readers - Text overflow handling with word wrapping
- High contrast borders for visual clarity
CSS Variables
The table component uses these CSS variables:--text-7- Font size--space-2,--space-3- Padding values--border- Border color--muted- Hover background color--muted-foreground- Header text color--transition-fast- Hover transition duration--font-medium- Header font weight