title | tags | meta | extension | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
TableKit extension |
|
|
|
import { CodeDemo } from '@/components/CodeDemo'
The TableKit
is a collection of all necessary Tiptap table extensions. If you quickly want to setup tables in Tiptap, this extension is for you.
npm install @tiptap/extension-table
Pass TableKit
to the editor to load all included extension at once.
import { Editor } from '@tiptap/core'
import { TableKit } from '@tiptap/extension-table'
const editor = new Editor({
extensions: [TableKit],
})
You can configure the included extensions, or even disable a few of them, like shown below.
import { Editor } from '@tiptap/core'
import { TableKit } from '@tiptap/extension-table'
const editor = new Editor({
extensions: [
TableKit.configure({
// Disable an extension
tableRow: false,
// Configure an extension
tableCell: {
HTMLAttributes: { class: 'list-item' },
},
}),
],
})