Table

A responsive table component for displaying structured data.

Installation

bash
npx shadcn@latest add table

Import

import {  Table,  TableHeader,  TableBody,  TableFooter,  TableHead,  TableRow,  TableCell,  TableCaption,} from "@/components/ui/table"

Basic invoices table

InvoiceStatusMethodAmount
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 div with rounded-md border for 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">