Space in Class Name
Posted on 2004-10-01
I have an asp page that displays some text which is formatted by a stylesheet. The colour of the text box depends on the text itself.
For example, the information displayed is a risk. If the risk is 'None', the box is white, if it is 'High', the box is red, etc.
The class is determined programmatically, according to the actual risk. In the stylesheet I have a class called 'None', another called 'High', etc.
The problem I have is that one of the risks is 'No Risk' which obviously has a space in it. The text MUST say 'No Risk' so the solution is not to have text with no space in.
How do I create a class in my stylesheet called No Risk? If I type it literally, with the space, it doesn't recognise it.
I have a procedure that selects the Risk from a database table. The asp page has the following line to set the class:
Response.Write "<td class=" & chr(34) & Replace((rs.Fields.Item("risk").Value) , " ", "") &"2" & chr(34) & ">" & (rs.Fields.Item("risk").Value) & "</td>"
Any help would be very gratefully receive it as I am rapidly running out of hair!