Skip to content

Install & Configuration - Tiptap V2 | Tiptap Table Plus

This guide covers installation and configuration for Tiptap V2.

To install the package for Tiptap V2, use npm:

Terminal window
npm install tiptap-table-plus@tiptap-v2

Note: The tiptap-v2 tag ensures you get the version compatible with Tiptap V2. Both versions are maintained and updated with each release.

This package works with peer dependencies. For Tiptap V2, you need to install separate packages for each table extension:

Terminal window
npm install @tiptap/extension-table @tiptap/extension-table-cell @tiptap/extension-table-header @tiptap/extension-table-row @tiptap/pm

Note: Make sure you have these peer dependencies installed as they are required for the package to function properly. The package will not work without these Tiptap extensions and ProseMirror.

For basic table functionality without pagination, import and use the WithoutPagination extension:

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 { WithoutPagination } from 'tiptap-table-plus';
const { TablePlus, TableRowPlus, TableCellPlus, TableHeaderPlus } = WithoutPagination;
const editor = new Editor({
extensions: [
TablePlus,
TableRowPlus,
TableCellPlus,
TableHeaderPlus,
],
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>',
});

For pagination table support, import the table extensions directly from tiptap-pagination-plus:

import { Editor } from '@tiptap/core';
import {
TablePlus, TableRowPlus, TableCellPlus, TableHeaderPlus
} from "tiptap-pagination-plus";
import { PaginationPlus } from "tiptap-pagination-plus";
const editor = new Editor({
extensions: [
TablePlus,
TableRowPlus,
TableCellPlus,
TableHeaderPlus,
PaginationPlus
],
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>',
});
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.

Links:

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