Skip to content

Type Editor


Type Editor / @type-editor/tables / utils/column-is-header / columnIsHeader

Function: columnIsHeader()

ts
function columnIsHeader(map, table, col): boolean;

Defined in: tables/src/utils/column-is-header.ts:26

Checks if an entire column consists only of header cells.

This function iterates through all rows of the table and checks if every cell in the specified column is a header cell.

Parameters

ParameterTypeDescription
mapTableMapThe TableMap for the table being checked.
tableNode_2The table node to check.
colnumberThe zero-based column index to check.

Returns

boolean

True if all cells in the column are header cells, false otherwise.

Example

typescript
const map = TableMap.get(tableNode);
if (columnIsHeader(map, tableNode, 0)) {
  console.log("First column is a header column");
}