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
| Parameter | Type | Description |
|---|---|---|
map | TableMap | The TableMap for the table being checked. |
table | Node_2 | The table node to check. |
col | number | The 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");
}