Skip to content

Example | Tiptap Table Plus

CommandParametersDefaultDescription
duplicateColumnwithContent (boolean)trueDuplicates the current column. If true, copies column content; if false, only duplicates the structure.
duplicateRowwithContent (boolean)trueDuplicates the current row. If true, copies row content; if false, only duplicates the structure.

Here are examples of how to use these commands in your Tiptap editor setup for both Tiptap V2 and V3:

import { Editor } from '@tiptap/core';
import { Table, TableRow, TableCell, TableHeader } from '@tiptap/extension-table';
import { WithoutPagination } from 'tiptap-table-plus';
const { TableKitPlus } = WithoutPagination;
const editor = new Editor({
extensions: [
TableKitPlus
],
content: '<table border="1"><tr><th colspan="1" rowspan="1"><p>Name</p></th><th colspan="1" rowspan="1"><p>Region</p></th><th colspan="1" rowspan="1"><p>Country</p></th></tr><tr><td colspan="1" rowspan="1"><p>Liberty Hays</p></td><td colspan="1" rowspan="1"><p>Araucanía</p></td><td colspan="1" rowspan="1"><p>Canada</p></td></tr></table>',
});

You can now use all the advanced table features in your editor.

Links:

tiptapplus.com is not an official Tiptap website and has no business affiliation with Tiptap.