@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 '@milkdown/preset-commonmark/lib/style.css';
import { table } from '@milkdown/plugin-table';
import '@milkdown/plugin-table/lib/style.css';
new Editor().use(commonmark).use(table).create();
Custom Keymap
import { tableNodes, tablePlugin, SupportedKeys, table } from '@milkdown/plugin-table';
import '@milkdown/plugin-table/lib/style.css';
new Editor()
.use(commonmark)
.use(
tableNodes.configure(table, {
keymap: {
[SupportedKeys.NextCell]: 'Enter',
[SupportedKeys.PrevCell]: 'Alt-Enter',
},
}),
)
.use(tablePlugin)
.create();
Keymap supported:
- NextCell: go to next cell of table.
- PrevCell: go to prev cell of table.
- ExitTable: exist current table.