LyteNyte Grid logo for light mode. Links back to the documentation home page.
Rows

Row Banding

Use alternating row background to improve visual separation between rows.

Row banding, also known as zebra striping, alternates row background colors to improve readability in dense tables. By default, LyteNyte Grid adds a data-ln-alternate="true" attribute to every other row. Target this attribute in CSS to apply alternating styles.

Alternate Row Shading

Set rowAlternateAttr to false to disable alternating row backgrounds.

In the demo below, turn the switch off to give all rows the same background, or turn it on to restore the alternating pattern.

Striped Rows

Fork code on stack blitzFork code on code sandbox

Note

rowAlternateAttr only controls whether LyteNyte Grid applies the data-ln-alternate attribute. To create visible row striping, target the data-ln-alternate attribute in your CSS.

Alternate Root Row Shading

You can apply alternate shading at the root row level. Passing "root" to rowAlternateAttr makes LyteNyte Grid assign the data-ln-alternate value based on the root row’s index rather than each individual row’s index.

When row groups are present, all children in a group inherit the same data-ln-alternate value as their top-level parent row.

Striped Root Rows

Fork code on stack blitzFork code on code sandbox

Next Steps