cellBackground
The cellBackground function returns a cell background color style when the input matches a target value.
Syntax
Section titled “Syntax”{input | cellBackground:target:color}Parameters
Section titled “Parameters”input(any): The value to checktarget(any): The value to match againstcolor(string): Hex color code to apply if values match
Returns
Section titled “Returns”- An object with
cellBackgroundproperty if input matches target nullif values don’t match or any parameter is null
Examples
Section titled “Examples”Basic color application
Section titled “Basic color application”{"Active" | cellBackground:"Active":"#00ff00"}// Returns: { cellBackground: "#00ff00" }Non-matching values
Section titled “Non-matching values”{"Inactive" | cellBackground:"Active":"#00ff00"}// Returns: nullStatus indicators
Section titled “Status indicators”{project.status | cellBackground:"Complete":"#28a745"}// Applies green background if project is completeNumber matching
Section titled “Number matching”{score | cellBackground:100:"#ffd700"}// Gold background for perfect scoresRisk level coloring
Section titled “Risk level coloring”{finding.priority | cellBackground:"P1":"#ff0000"}// Red background for P1 priority findingsUse Cases
Section titled “Use Cases”- Conditional formatting in report tables
- Status-based cell highlighting
- Performance indicator coloring
- Priority-based visual cues
- Dynamic table styling based on data values