Infinite Table Documentation
/ latest / 2021-08-30

Styling rows

Rows can be styled by using the

rowStyle
and the
rowClassName
props

  • rowStyle
    can be a style
    object
    or a
    function
    that returns a style
    object
    or
    undefined
  • rowClassName
    can be a
    string
    (the name of a CSS class) or a
    function
    that returns a
    string
    or
    undefined
Defining row style
const rowStyle: InfiniteTablePropRowStyle<Employee> = ({ data }) => {
// data could be undefined for group rows, so we are using the nullish coalescing operator
const salary = data?.salary ?? 0;
if (salary > 150_000) {
return { background: "tomato" };
}
};

Row styling example

Row styling