SpreadJS supports conditional formatting in cells. You can use various styles to set the visual appearance of the formatted cell.
Conditional formatting can be applied to worksheets via conditional formatting rules. Classes such as ConditionalFormatting and ConditionalFormats can be used to access various different methods and enumeration options.
There are several types of conditional rules. The following table lists the rules and their descriptions:
The average rule checks for values above or under the average.
The cell value rule compares values.
The data bar rule uses a bar that is displayed as the background for each cell. The length of the bar is based on the cell value.
The date rule compares dates.
The duplicate rule checks for duplicate values.
The formula rule allows you to use formulas when checking the condition.
The icon set rule displays icons based on the values. You can specify the type of icon and whether to show the icon or the icon and the data in the cell.
The scale rule uses a sliding color scale.
The specific text rule searches for text strings.
The top 10 rule checks for values in the top or bottom of the range.
The unique rule checks to see if the value is the only one of that value in the range.
These rules have an order of precedence. The last rule in a list of rules has the highest precedence. The first rule in the list has the lowest precedence. By default, new rules are always added last and have the highest precedence. When two rules conflict, the rule with higher precedence is applied. If two rules do not conflict (one rule uses a bold font and the other rule uses a cell back color), then both rules are applied.