Define a Formatter
Formatters are named definitions in theformatters section of your sheet configuration. Each formatter contains an array of rules, where each rule has an expression (condition) and a style (to apply when the condition is true).
expression property accepts a string that evaluates as a condition. When the expression evaluates to true, the referenced style is applied to the cell.
Apply a Formatter to a Column
Reference the formatter by name in the column’sformatter property:
formatters section.
Create a Read-Only Formatter
A common pattern is using a formatter to visually indicate read-only columns by combiningisreadOnly with the built-in readOnly style:
Formatter Evaluation Flow
Use Multiple Rules
A formatter can contain multiple expression-style pairs. Rules are evaluated in order:Complete Example
Verify
After saving the sheet configuration, reload the powersheet document. You should now see cells in the formatted columns displaying the background colors, font weights, or other CSS properties defined by the matched style rules.See also
Sources
Sources
KB ArticlesSupport TicketsSource Code
prod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/configurations/whole_rtm.template.yamlprod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/packages/common/types/api/document.tspowersheet.yamlprod-powersheet-src/com.nextedy.powersheet.client/src/modules/Powersheet/Powersheet.tsxprod-powersheet-src/com.nextedy.powersheet/src/META-INF/hivemodule.xml