If I may offer an alternative way to do the same but by different means and with some more configurability?
The table has another feature, under Miscellaneous options, to highlight table cells that are above or below a certain threshold: contents.threshold.high and contents.threshold.low
If you enter 0 (zero) for both values, you will achieve the same ‘positive/negative’ effect, albeit with different default styling: the background will be red or green.
The styling for this a bit awkward to override (needs !important or very specific selectors), but the following should get you there, for table cells:
.tag-table td.cell.annotation-threshold-high {
background-color: transparent !important;
color: green !important;
}
.tag-table td.cell.annotation-threshold-low {
background-color: transparent !important;
color: red !important;
}
You might want something less vividly red and green… ;-)
Added value is that you get to use the threshold functionality: flexible definitions and if you leave one of the two open, you can also choose to color just positives or the other way round.
And, finally, that you don’t depend on the presence of the input
element and its value
attribute contents (an implementation detail which might change sooner than the threshold classes)