Tables.
Table styles, cell shading, merged cells, resizable columns and totals that update as you type. Paste cells straight from a spreadsheet.
Try this.
- Change a number in a Units column and watch the total row update
- Click into a table and pick another style from the table bar
- Drag a column border to resize it
- Press Shift+F10 in a cell for the full table menu
- Copy cells from a spreadsheet and paste them into a table
The code.
import { createRichTextEditor } from '@better-rich-text/core';
const editor = createRichTextEditor('#editor', {
toolbar: 'table tableMenu tableStyle tableShading',
});
// In a totals row, cells with data-formula="sum"
// add up their column as you type.
editor.setHTML(`
<table class="brt-table-ledger brt-total-row">
…
<tr><th>Total</th><td data-formula="sum"></td></tr>
</table>`);