Type Editor / @type-editor/tables / utils/find-cell / findCell
Function: findCell()
ts
function findCell($pos): Rect;Defined in: tables/src/utils/find-cell.ts:22
Finds the rectangular bounds of the cell at the given position.
Uses the table map to determine the cell's position in the table grid, accounting for any rowspan or colspan that may affect its bounds.
Parameters
| Parameter | Type | Description |
|---|---|---|
$pos | ResolvedPos | A resolved position pointing at or within a cell. |
Returns
A rectangle describing the cell's bounds in the table grid.
Example
typescript
const rect = findCell($cellPos);
console.log(`Cell spans from column ${rect.left} to ${rect.right}`);