TanStack

table_getCellSelectionMergeBounds

Function: table_getCellSelectionMergeBounds()

ts
function table_getCellSelectionMergeBounds<TFeatures, TData>(table): CellSelectionBounds[];

Defined in: features/cell-selection/cellSelectionFeature.utils.ts:255

Resolves the merged-cell rectangles of the rendered rows into selection's own index space.

The span index positions rows by their paginated render order while selection positions them by pre-paginated display order, so each merge is mapped through row.getDisplayIndex(). A merge whose rows do not map to a contiguous display range is skipped defensively; it then behaves like unmerged cells instead of corrupting the geometry.

Returns an empty array when cellSpanningFeature is not registered, which keeps every selection code path identical to the span-unaware behavior.

Type Parameters

TFeatures

TFeatures extends TableFeatures

TData

TData extends RowData

Parameters

table

Table_Internal<TFeatures, TData>

Returns

CellSelectionBounds[]

Example

ts
const merges = table_getCellSelectionMergeBounds(table)