I must say I'm an absolute newbie in all this. I am writing a small xslt presentation file, with a table, and I would like to change the background color of either the cell or the line (either will do, but I would prefer changing only the cell background) depending on the content.
Example: RATING = "GOOD" "MEDIUM" "BAD"; depending on its value I want the background to be green, yellow or red.
My current table code:
<table width="1000" border="0" cellspacing="0" cellpadding="0" class="table-fill">
<thead>
<tr>
<th scope="col">NAME</th>
<th scope="col">VALUE</th>
<th scope="col">RATING</th>
<th scope="col">DESCRIPTION</th>
</tr>
</thead>
<tbody>
<xsl:for-each select="test/criteria">
<tr>
<td><xsl:value-of select="@nom" /></td>
<td><xsl:value-of select="value" /></td>
<td><xsl:value-of select="rating" /></td>
<td><xsl:value-of select="descr" /></td>
</tr>
</xsl:for-each>
</tbody>
</table>
Thank you in advance
--EDIT-- My question has been answered by @Yaakov Ainspan and resolved by @Ruud who gave me the bits of code I was lacking.
It's not a duplicate of "Is there a CSS selector for elements containing certain text?" because I didn't need to isolate a element from a string containing more than just my element, just to create classes with the same name as the content of a cell (which was in this case a single word)