Table
A responsive table component for displaying structured data.
Installation
bash
npx shadcn@latest add tableImport
import { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption,} from "@/components/ui/table"Basic invoices table
| Invoice | Status | Method | Amount |
|---|---|---|---|
| INV-001 | Paid | Credit Card | $250.00 |
| INV-002 | Pending | Bank Transfer | $150.00 |
| INV-003 | Unpaid | PayPal | $350.00 |
| INV-004 | Paid | Credit Card | $450.00 |
Props
All parts extend their native HTML equivalents (table, thead, tbody, tr, th, td) and pass through className.
Notes
- Wrap the Table in a
divwithrounded-md borderfor the standard card look - Table is semantic HTML — not a data-grid library. For sortable/filterable tables, pair with TanStack Table
- For horizontal scroll on mobile: wrap in
<div className="overflow-x-auto">