---
title: "TableHeader extension"
description: "Improve tables with Tiptap’s TableHeader extension. Easily control table headers. Source code and usage examples in the docs!"
canonical_url: "https://tiptap.dev/docs/editor/extensions/nodes/table-header"
---

# TableHeader extension

Improve tables with Tiptap’s TableHeader extension. Easily control table headers. Source code and usage examples in the docs!

This extension complements the [`Table`](https://tiptap.dev/docs/editor/extensions/nodes/table.md) extension and adds… you guessed it… table headers to them.

> **Interactive demo:** [Table](https://embed.tiptap.dev/preview/Nodes/Table)

## Install

```bash
npm install @tiptap/extension-table
```

This extension requires the [`Table`](https://tiptap.dev/docs/editor/extensions/nodes/table.md) extension to be installed.

This extension is installed by default with the `TableKit` extension, so you don’t need to install it separately.

```ts
import { Editor } from '@tiptap/core'
import { TableKit } from '@tiptap/extension-table'

new Editor({
  extensions: [TableKit],
})
```

## Usage

Table headers are optional. But come on, you want them, don’t you? If you don’t want them, update the `content` attribute of the [`TableRow`](https://tiptap.dev/docs/editor/extensions/nodes/table-row.md) extension, like this:

```js
// Table rows without table headers
TableRow.extend({
  content: 'tableCell*',
})
```

This is the default, which allows table headers:

```js
// Table rows with table headers (default)
TableRow.extend({
  content: '(tableCell | tableHeader)*',
})
```

## Source code

[packages/extension-table-header/](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-table/src/header)

## Minimal Install

```js
import { Editor } from '@tiptap/core'
import { TableHeader } from '@tiptap/extension-table/header'

new Editor({
  extensions: [TableHeader],
})
```
