Changing cell background color based on contents

I have a very simple webpage displaying survey results from a database. The results are displayed in a table format. I would like to have the individual cells background color change based on the cell’s content.

Example: If the survey response is “Very Satisfied” the cell would have a green background. If the response is “Very Dis-satisfied” the background would show red.

I’ve been looking for how I can get this done via style sheet but so far I haven’t had any luck… any thoughts??

Keith

As far as I know, there is no way to use the text content of an element to effect changes in CSS.

You might be able to use Javascript to dynamically add a class depending on the cell contents, but I don’t know anywhere near enough JS to be able to tell you how!