What is @tiptap/extension-table-row?
@tiptap/extension-table-row is an extension for the Tiptap editor that allows you to add and manage table rows within your rich text editor. It provides functionalities to create, manipulate, and customize table rows, making it easier to handle tabular data in a user-friendly way.
What are @tiptap/extension-table-row's main functionalities?
Add Table Row
This feature allows you to add a new row to an existing table in the Tiptap editor. The code sample demonstrates how to import the TableRow extension and use the `insertTableRow` command to add a new row.
import { TableRow } from '@tiptap/extension-table-row';
const editor = new Editor({
extensions: [
TableRow,
],
});
// Add a new row to the table
editor.chain().focus().insertTableRow().run();
Delete Table Row
This feature allows you to delete a row from an existing table in the Tiptap editor. The code sample demonstrates how to use the `deleteTableRow` command to remove the current row.
import { TableRow } from '@tiptap/extension-table-row';
const editor = new Editor({
extensions: [
TableRow,
],
});
// Delete the current row from the table
editor.chain().focus().deleteTableRow().run();
Move Table Row
This feature allows you to move a row up or down within a table in the Tiptap editor. The code sample demonstrates how to use the `moveTableRow` command with a parameter to move the current row up or down.
import { TableRow } from '@tiptap/extension-table-row';
const editor = new Editor({
extensions: [
TableRow,
],
});
// Move the current row up
editor.chain().focus().moveTableRow(-1).run();
// Move the current row down
editor.chain().focus().moveTableRow(1).run();
Other packages similar to @tiptap/extension-table-row
prosemirror-tables
prosemirror-tables is a ProseMirror plugin that provides table-related functionalities similar to @tiptap/extension-table-row. It allows you to create, edit, and manage tables within a ProseMirror editor. While it offers a comprehensive set of table manipulation features, it requires more manual setup compared to the Tiptap extension.
slate-tables
slate-tables is a plugin for the Slate editor that provides table functionalities. It allows you to add, delete, and manipulate table rows and columns within a Slate editor. Compared to @tiptap/extension-table-row, it is designed specifically for the Slate editor and offers similar table management capabilities.
draft-js-table-plugin
draft-js-table-plugin is a plugin for the Draft.js editor that adds table functionalities. It allows you to create and manage tables within a Draft.js editor. While it provides similar features to @tiptap/extension-table-row, it is tailored for use with Draft.js and may require additional configuration.
@tiptap/extension-table-row
Introduction
Tiptap is a headless wrapper around ProseMirror – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as New York Times, The Guardian or Atlassian.
Official Documentation
Documentation can be found on the Tiptap website.
License
Tiptap is open sourced software licensed under the MIT license.