mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-03 02:39:02 +08:00
1.3 KiB
1.3 KiB
description | icon |
---|---|
Tables don’t require a header, but let’s be honest: They look better with it. | t-box-line |
TableHeader
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
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
npm install @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/