Conditional cell colour-coding and decimal formatting - can both work together?
Posted: Sun Nov 16, 2025 5:25 pm
Hello,
I'm developing a jamovi module (mentioned here: viewtopic.php?t=4082) and have been scratching my head for quite a while on the following.
I want to conditionally colour-code table cells based on threshold values (e.g., red for significant positive, blue for significant negative) and have the values respect jamovi's decimal formatting preferences.
What I've discovered:
Using table$addFormat(rowKey, col, "css-class-name") works for colour-coding, but only with type: text columns
However, text columns ignore jamovi's formatting system, so I must hardcode decimal places.
Using 'type: number', columns respects jamovi's formatting beautifully, but the CSS classes don't seem to apply
I've tried a few approaches (HTML spans, moving CSS files around, etc.) but keep hitting this same wall.
Question:
An I missing something obvious? How can I have conditional styling and native decimal formatting coexist in Jamovi ?
Happy to provide code examples if that would help.
Thanks,
Gianmarco
I'm developing a jamovi module (mentioned here: viewtopic.php?t=4082) and have been scratching my head for quite a while on the following.
I want to conditionally colour-code table cells based on threshold values (e.g., red for significant positive, blue for significant negative) and have the values respect jamovi's decimal formatting preferences.
What I've discovered:
Using table$addFormat(rowKey, col, "css-class-name") works for colour-coding, but only with type: text columns
However, text columns ignore jamovi's formatting system, so I must hardcode decimal places.
Using 'type: number', columns respects jamovi's formatting beautifully, but the CSS classes don't seem to apply
I've tried a few approaches (HTML spans, moving CSS files around, etc.) but keep hitting this same wall.
Question:
An I missing something obvious? How can I have conditional styling and native decimal formatting coexist in Jamovi ?
Happy to provide code examples if that would help.
Thanks,
Gianmarco