How to highlight max or min data?

181 views Asked by At

If I have an NxM grid of tabulator data that's numerical, I want to bold or highlight the cell that's maxmimum in a row or maximum in a column. I was wondering the best way to do this. It seems like I should pass in the row into a custom formatter, then iterate over the entries to get the max and return the format as bold or whatever.

This just seems a little calculation heavy as I have to iterate over all the cells for each row. Anyone have a better idea? Is there a built in way to get this? I couldn't find it in the documentation.

1

There are 1 answers

0
Oli Folkerd On

The most efficient way to handle this would be to identify the max/min values before importing them into the table by simply iterating over the array.

You could then set some flag properties in the row data(eg minRow, maxRow) that are set true if they apply, and then in the rowFormatter function use these to apply appropriate styling