Skip to content

@jsvision/datagrid / gutterLabel

Function: gutterLabel()

gutterLabel(index0, width): string

Defined in: datagrid/src/synthetic-columns.ts:100

The right-aligned 1-based display number for a body row, padded to width with a trailing gap cell so the number never touches the first data column.

Parameters

index0

number

The 0-based display index of the row.

width

number

The gutter width in cells (see prefixWidth).

Returns

string

A width-cell string: the right-aligned index0 + 1 plus a trailing space.

Example

ts
import { gutterLabel } from '@jsvision/datagrid';
gutterLabel(0, 4); // '  1 '  (display row 1)
gutterLabel(99, 4); // '100 '