This is an example of an MDXEditor table plugin that uses lexical element nodes to represent table structures.
Warning: Use this as a base for your own table plugin. Most of it is an adaptation of the original lexical table plugin, while removing parts that do not make sense for the markdown table nodes.
The built-in table plugin uses decorator nodes and nested lexical editors. Nested editors are quite complex to support in collaborative mode (they require nested collaboration plugins to be added).
The trade-off is that lexical element nodes are very restrictive. You cannot use React directly to add interaction to them. This makes building table tools complicated and somewhat brittle - see TableUI.tsx
.