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

> This page is for Tiptap 2.x. [See the latest version of this page.](https://tiptap.dev/docs/editor/extensions/nodes/table-header.md)

# 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/v2/editor/extensions/nodes/table.md) extension and adds… you guessed it… table headers to them.

> **Interactive demo:** [Table](https://v2--tiptap-embed.netlify.app/preview/Nodes/Table)

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/v2/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)*',
})
```

## Install

```bash
npm install @tiptap/extension-table @tiptap/extension-table-row @tiptap/extension-table-header @tiptap/extension-table-cell
```

This extension requires the [`Table`](https://tiptap.dev/docs/v2/editor/extensions/nodes/table.md), [`TableRow`](https://tiptap.dev/docs/v2/editor/extensions/nodes/table-row.md) and [`TableCell`](https://tiptap.dev/docs/v2/editor/extensions/nodes/table-cell.md) nodes.

## Source code

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