What is @tiptap/extension-table-cell?
@tiptap/extension-table-cell is an extension for the Tiptap editor that provides functionality for working with table cells. It allows you to create, manipulate, and style table cells within the Tiptap rich-text editor.
What are @tiptap/extension-table-cell's main functionalities?
Create Table Cell
This feature allows you to create a table cell within the Tiptap editor. By including the TableCell extension, you can add table cells to your editor.
import { TableCell } from '@tiptap/extension-table-cell';
const editor = new Editor({
extensions: [
TableCell,
],
});
Set Cell Attributes
This feature allows you to set custom attributes for table cells. In this example, a custom class is added to the table cells.
import { TableCell } from '@tiptap/extension-table-cell';
const editor = new Editor({
extensions: [
TableCell.configure({
HTMLAttributes: {
class: 'my-custom-class',
},
}),
],
});
Merge Cells
This feature allows you to merge multiple table cells into one. The mergeCells command is used to perform the merge operation.
import { TableCell, mergeCells } from '@tiptap/extension-table-cell';
const editor = new Editor({
extensions: [
TableCell,
],
});
// Example function to merge cells
editor.commands.mergeCells();
Other packages similar to @tiptap/extension-table-cell
prosemirror-tables
prosemirror-tables is a ProseMirror plugin that provides table-related functionality. It allows you to create and manipulate tables within a ProseMirror editor. Compared to @tiptap/extension-table-cell, prosemirror-tables is more low-level and requires more manual setup.
slate-tables
slate-tables is a plugin for the Slate editor that adds support for tables. It provides similar functionality to @tiptap/extension-table-cell, such as creating and manipulating table cells. However, it is designed specifically for the Slate editor.
draft-js-table-plugin
draft-js-table-plugin is a plugin for Draft.js that adds table support. It allows you to create and edit tables within a Draft.js editor. While it offers similar features to @tiptap/extension-table-cell, it is tailored for use with Draft.js.
@tiptap/extension-table-cell
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.
Offical Documentation
Documentation can be found on the tiptap website.
License
tiptap is open sourced software licensed under the MIT license.