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');