Skip to content

Example

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 is an example of how to use these commands in your Tiptap editor setup:

import { Editor } from '@tiptap/core';
import TableRow from '@tiptap/extension-table-row';
import TableCell from '@tiptap/extension-table-cell';
import TableHeader from '@tiptap/extension-table-header';
import TiptapTablePlus from 'tiptap-table-plus';
const editor = new Editor({
extensions: [
TiptapTablePlus,
TableRow,
TableCell,
TableHeader,
],
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 image features in your editor.

Links: