@milkdown/plugin-table
Table plugin for milkdown.
Add support for table commands.
Example Usage
import { Editor } from '@milkdown/core';
import { commonmark } from '@milkdown/preset-commonmark';
import '@milkdown/theme-nord/lib/theme.css';
import { table } from '@milkdown/plugin-table';
import '@milkdown/plugin-table/lib/style.css';
const root = document.body;
new Editor({ root }).use(commonmark).use(table()).create();
Custom Keymap
import { table, SupportedKeys } from '@milkdown/plugin-table';
import '@milkdown/plugin-table/lib/style.css';
const root = document.body;
new Editor({ root })
.use(commonmark)
.use(
table({
keymap: {
[SupportedKeys.NextCell]: 'Enter',
[SupportedKeys.PrevCell]: 'Alt-Enter',
},
}),
)
.create();
Keymap supported:
- NextCell: go to next cell of table.
- PrevCell: go to prev cell of table.
- ExitTable: exist current table.