Overview
The Tables plugin provides powerful table creation and editing capabilities with cell formatting, styling, and data management.
Features
- â Create tables with custom rows and columns
- â Add/remove rows and columns
- â Merge cells
- â Cell formatting (bold, italic, colors)
- â Table styling (borders, background)
- â Header rows
- â Copy/paste table data
Installation
npm install @editora/plugins/table
Basic Usage
import { Editor } from '@editora/core';
import { TablePlugin } from '@editora/plugins/table';
const editor = new Editor({
element: '#editor',
plugins: [TablePlugin()]
});
Creating a Table
- Click the "Insert Table" button in the toolbar
- Enter desired rows and columns
- Click "Create"
Table Commands
// Insert table
editor.execCommand('insertTable', { rows: 3, cols: 3 });
// Add row
editor.execCommand('addTableRow', { position: 'after' });
// Delete row
editor.execCommand('deleteTableRow');
// Add column
editor.execCommand('addTableColumn', { position: 'after' });
// Merge cells
editor.execCommand('mergeCells');