# $styleResultColumn and $styleResultRows

These two customization keywords allows us to format the look of cells and rows. Both keywords are more suitable for use cases when you have a field with a fixed set of possible values - $[].

# Installation:

cob-cli customize styleResults

# $styleResultColumn

Whenever the value of a field matches the key indicated as an argument inside the keyword, the cells of a column in the instances listing will be styled according to a custom CSS class. The custom CSS class is given as a value given to the key of the keyword.

# Usage:

$styleResultColumn(key1:value1,key2:value2,key3:value3,...)

# Examples:

The example included below styles the look of any cells in the Warning column whose values matches the characters "Fire" (with the background color in red), "Weather" (with the background color in blue), "UV" (with the background color in orange), and "Nothing" (with the background color in gray):

$styleResultColumn(Fire:BgRed,Weather:BgBlue,UV:BgOrange,Nothing:BgGray)

# $styleResultRows

This keyword styles the look of all cells of rows where the value of the field built with this keyword matches the key indicated as an argument.

# Usage:

$styleResultRows(key1:value1,key2:value2,key3:value3,...)

# Examples:

The example included below only styles the look of all cells - with the exception of links - in all rows where the value of the Warning field matches the terms "Fire", "Weather", "UV" or "Nothing":

$styleResultRows(Fire:Red,Weather:DimBlue,UV:BgOrange,Nothing:DimGray)

WARNING

Please note that $styleResultRows only works for the first field occurrence matching a value. This means that other subsequent usages of this keyword in a given definition will be ignored.

TIP

Both the $styleResultColumn and the $styleResultsRow keywords also accept an empty value - i.e. $styleResultColumn(:BgDimGray) - or an asterisk - i.e. $styleResultColumn(*:DimGreen) - as the key, as can be seen in the images included below:


In case the keyword contains more than one key:value pair, the option containing the asterisk as the key must be the last one. Otherwise, it will override the other options.

WARNING

Fields containing either $styleResultColumn or $styleResultRow only work as expected when used in simultaneously with the $instanceDescription keyword.

# Font color CSS classes

Below, we include a list of the custom CSS classes you can use to change the color of either the font or the background of the instance listings of a given definition. Please note that, at the moment, none of the available classes apply to the font color of any colums where the values of the cells consist in links.

Name Example
DimGreen
Portugal
DimRed
Portugal
DimOrange
Portugal
DimGray
Portugal
Red
Portugal
Green
Portugal
Blue
Portugal
Orange
Portugal
Gray
Portugal

# Background color CSS classes

Name Example
BgRed
BgGreen
BgBlue
BgOrange
BgGray
BgDimRed
BgDimGreen
BgDimBlue
BgDimOrange
BgDimGray