tiptap/docs/api/nodes/table-header.md
2021-10-14 21:20:21 +02:00

1.5 KiB
Raw Blame History

description icon
Tables dont require a header, but lets be honest: It looks better with it. table-line

TableHeader

Version Downloads

Table headers are optional. But come on, you want them, dont you? If you dont want them, update the content attribute of the TableRow extension, like this:

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

This is the default, which allows table headers:

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

Installation

# with npm
npm install @tiptap/extension-table @tiptap/extension-table-row @tiptap/extension-table-header @tiptap/extension-table-cell

# with Yarn
yarn add @tiptap/extension-table @tiptap/extension-table-row @tiptap/extension-table-header @tiptap/extension-table-cell

This extension requires the Table, TableRow and TableCell nodes.

Source code

packages/extension-table-header/

Usage