# Table

> Data table primitives that match the rest of the surfaces.

Registry name: `table`. HTML docs: https://ui.anuragroy.dev/component/table.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/table.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/table.json`.

Registry JSON: https://ui.anuragroy.dev/r/table.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/table.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

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

## Usage

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

export function Example() {
  return (
    <Table>
      <TableCaption>Recent invoices</TableCaption>
      <TableHeader>
        <TableRow>
          <TableHead>Invoice</TableHead>
          <TableHead>Status</TableHead>
        </TableRow>
      </TableHeader>
      <TableBody>
        <TableRow>
          <TableCell>INV001</TableCell>
          <TableCell>Paid</TableCell>
        </TableRow>
      </TableBody>
    </Table>
  )
}
```

## API

### Table

Styled `table`. Also exports `TableFooter`.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | string | — |  |

## See also

- [HTML page](https://ui.anuragroy.dev/component/table): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/table.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
