How Cell Styles Work
The styling system uses three interconnected configuration properties:styles— defines named CSS class rulescellDecorators— JavaScript functions that apply CSS classes conditionally based on cell valuescellCss/headerGroupCss— static CSS class assignment per column
Step 1: Define Style Classes
Add CSS class definitions to thestyles object in your risksheet.json. Each key is a CSS selector pattern and the value is the CSS rule:
Style Naming Patterns
| Pattern | Purpose | Example |
|---|---|---|
.className | General cell class | .boldCol, .rpn1 |
.firstRow .groupName | First row of a column group | .firstRow .headSysReq |
.lastRow .groupName | Last row of a column group | .lastRow .headSysReq |
Step 2: Apply Static Styles to Columns
To apply a CSS class to every cell in a column regardless of its value, use thecellCss property on the column definition:
headerGroupCss:
Step 3: Apply Conditional Styles via Decorators
For dynamic styling based on cell values, define cell decorator functions and pair them with style definitions:info object with these properties:
| Property | Description |
|---|---|
info.value | Current cell value |
info.cell | DOM element of the cell |
info.item | Full work item data object |
Step 4: Style Column Group Headers
Use thefirstRow and lastRow pseudo-selectors to apply different styling to the first and last rows within a column group:
Step 5: Configure Header Heights
Control the pixel height of column headers and column group headers using theheaders property:
Step 6: Limit Row Height
Risksheet does not have a built-in row height limit, but you can control it using a cell decorator with CSSmax-height:
Export Considerations
Cell styles carry over to exports differently depending on the format:| Export Format | Style Behavior |
|---|---|
| Excel | Background colors and text colors from the grid are preserved |
| Cell formatting is controlled by the custom PDF export script, not the grid styles |
Verification
After saving your configuration changes and reloading the Risksheet page, you should now see:- Custom background colors and text colors applied to cells matching your style definitions
- Conditional coloring that changes dynamically as cell values are edited
- Column group headers with distinct first-row and last-row styling
- Bold text or other font styling on columns with
cellCssassigned
See Also
- Apply Conditional Formatting — cell decorator function reference and advanced patterns
- Configure Row Header Styles — row header customization
- Configure Item Colors — severity-based coloring
- Add Header Tooltips — informative header tooltips
Sources
Sources
KB Articles
- Configure cell - column styles colors fonts …
- Configure the style of row header
- Risksheet Document Config File - risksheet - format reference
AppConfig.tsrisksheet.jsonExportToExcel.tsAppConfigHelper.tsExportToPdf.ts