Skip to content

Type Editor


Type Editor / @type-editor/tables / utils/cell-wrapping

utils/cell-wrapping

Functions

FunctionDescription

cellWrapping

Finds the cell node that wraps the given position.

Unlike cellAround, this function returns the actual cell node rather than a resolved position. It checks the current depth and all ancestor nodes to find a cell.

Example

typescript
const cellNode = cellWrapping(state.selection.$head);
if (cellNode) {
  console.log("Cell colspan:", cellNode.attrs.colspan);
}