---
title: Table
description: A responsive table component.
---

<ComponentPreview name="table-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/table-demo.tsx

```

</ComponentPreview>

## Installation

<ComponentInstallation>

<Step>

<StepItem>Copy and paste the following code into your project:</StepItem>

  <ComponentSourceTabs>

    ```tsx title="components/ui/table" file=<rootDir>/apps/docs/src/registry/ui/table.tsx

    ```

    ```tsx title="components/ui/table" file=<rootDir>/apps/unocss-playground/src/registry/ui/table.tsx

    ```

  </ComponentSourceTabs>

</Step>

</ComponentInstallation>

## Usage

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

```tsx
<Table>
  <TableHeader>
    <TableRow>
      <TableHead />
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableCell />
    </TableRow>
  </TableBody>
</Table>
```
