Understand `TableMap` for table structure
masterA TableMap is a cached representation of a table's structure. It uses positions relative to the start of the table (rather than the document) to allow for efficient caching per table node.
Properties
width: The number of columns in the table.height: The number of rows in the table.map: A flat array of sizewidth * heightcontaining the start position of the cell covering each slot.
Methods
static get(table: Node): Retrieves theTableMapfor a specific table node.findCell(pos: number): Returns theRect(dimensions) of the cell at the given position.colCount(pos: number): Returns the left-side column index of the cell at the given position.nextCell(pos: number, axis: string, dir: number): Finds the next cell in the specifiedaxisanddir.rectBetween(a: number, b: number): Returns theRectspanning the two given cells.cellsInRect(rect: Rect): Returns an array of positions for all cells whose top-left corner is within the given rectangle.positionAt(row: number, col: number, table: Node): Returns the position where a cell at the specified row/column would start.