Table
A responsive table component for displaying tabular data with header, body, footer, and caption support.
| Name | Status | Role |
|---|---|---|
| Alice | Active | Admin |
| Bob | Inactive | User |
Installation
npx shadcn add table --registry https://ui.ch.sh/r
Usage
import {
Table,
TableHeader,
TableBody,
TableRow,
TableHead,
TableCell,
} from "@/components/ui/table"
export default function Example() {
return (
<Table>
<TableHeader>
<TableRow>
<TableHead>Column 1</TableHead>
<TableHead>Column 2</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>Data 1</TableCell>
<TableCell>Data 2</TableCell>
</TableRow>
</TableBody>
</Table>
)
}