Re: pseudoclass based on document content

That would work...

...unless you're already specifying a uniform style for the TDs:

<td class="financial">123</td>
<td class="financial">-123</td>
<td class="financial">(none)</td>

Assuming the numbers and table are being generated by code, I'd
could avoid the CLASS conflict this way:

<td class="financial" STYLE="color:black;">123</td>
<td class="financial" STYLE="color:red;">-123</td>
<td class="financial" STYLE="color:black;">(none)</td>

But then we've just totally blown a hole through the wall separating
content/programming and style.

--justin


On Fri, 16 Jul 2004, Andrew Fedoniouk wrote:

> > The benefit of this approach being that if negative numbers in your
> > document are surrounded by parentheses, you can modify the regular
> > expression in the stylesheet rather than having to modify your document to
> > play nice with a UA's implementation of ":negative-number".
>
> If you already have some code producing numbers in cells then why you cannot
> change it to produce:
> <td class="positive">123</td>
> <td class="negative">-123</td>
> <td class="undefined">(none)</td>
> etc. ?
>
> Just to keep it simple...
>
> Andrew Fedoniouk.
> http://terrainformatica.com

Received on Friday, 16 July 2004 18:10:31 UTC