A common thing one wants to do in a table of financial figures is to turn negative numbers red. Given that folks would rather use CSS than <font>, there's some conflicting thinking around the right way to do it.
Some propose adding "negative" a css class like:
<TD CLASS="financial negative">-190</TD>
but others find that distasteful and say:
- number is a data type.
- currency is both a presentational instruction and a sub-type of the number data type.
- negative is neither type nor presentational — it’s dependent on the data value, not the type or the author’s formatting preference. It doesn’t belong there. [Xaprb]
and go on to provide a clever CSS-only technique that works everywhere but IE6 (demo here).
In the specific situation I've got, I'd like to make the change without changing any server-side code (which precludes adding a "negative" css class) and I need it to work everywhere (which nixes clever css).
May not be Web 2.0, and it likely doesn't please the standards wonks, but it works.
UPDATE: Similar attempt seen here.