---
title: "Tables"
description: "Table extensions add tables to the editor, with commands to add and delete rows and columns, merge and split cells, and set header cells."
canonical_url: "https://tiptap.dev/docs/editor/extensions/tables"
---

# Tables

Table extensions add tables to the editor, with commands to add and delete rows and columns, merge and split cells, and set header cells.

## When you use them

- **Data in rows and columns.** Table inserts a table, three by three with a header row by default, and adds or deletes rows and columns.
- **Headers.** Table header adds header cells. Commands turn the current row, column, or cell into a header.
- **Merged cells.** Table merges the selected cells into one and splits a merged cell again.
- **Cell attributes.** `setCellAttribute()` sets an attribute you defined on Table cell, for example a background color.

## How they work

- **A table is four nodes.** Table holds Table rows, and each row holds Table cells and Table headers. Table cell, Table header, and Table row each require Table. [Nodes and marks](https://tiptap.dev/docs/editor/core-concepts/nodes-and-marks.md)
- **The Table kit bundles them.** The [Table kit](https://tiptap.dev/docs/editor/extensions/functionality/table-kit.md) holds Table, Table cell, Table header, and Table row. Tables aren't part of the [StarterKit](https://tiptap.dev/docs/editor/extensions/functionality/starterkit.md).
- **Commands do the editing.** Table's commands, such as `addRowAfter()` and `mergeCells()`, change the table, and `goToNextCell()` and `goToPreviousCell()` move between cells.
- **Headers are optional.** To allow no headers, change the `content` of Table row so it holds only cells.

## Related

- [Text blocks](https://tiptap.dev/docs/editor/extensions/text-blocks.md) and [Lists](https://tiptap.dev/docs/editor/extensions/lists.md) are the other blocks of a document.
- [Extend an existing extension](https://tiptap.dev/docs/editor/extensions/custom-extensions/extend-existing.md) to add your own attributes to table cells.
