I've been trying to figure out how to make the background of a specific cell in a table change color when you click on a link. Here's a simple mockup for an example:
(stylesheet)
.redback {background-color: red; }
.yellowback {background-color:yellow;}
.orangeback {background-color:orange;}
Example:
<table>
<tr>
<td><<link "Apple">><<addclass "td" "redback">><</link>></td>
<td><<link "Banana">><<addclass "td" "yellowback">><</link>></td>
<td><<link "Orange">><<addclass "td" "orangeback">><</link>></td>
</tr>
</table>
As you can probably tell, it changes the background of the entire table - not the specific cell like I want it to. I've been fiddling with this for a few days, trying to figure it out on my own (and googling like crazy for help), but I haven't managed to figure anything out.
I'm sure the problem is that 'addclass' is changing all the 'td' elements, but trying to change what they're called breaks the table. I'm not yet experienced enough to know whether there's a simpler solution that I'm overlooking, or if it's even possible at all. Any help would be appreciated!