Forums

ASP

This topic is locked

Certain color for certain dynamic data

Posted 26 Nov 2007 13:08:58
1
has voted
26 Nov 2007 13:08:58 egy eng posted:
i run a query and the results show in a table, one of the fields will
show one of only 3 words (closed, pending and new)
I am trying to show each word in a different color, like if it show
"closed" it will be in red, if it show "pending" it will be in green,
and so on.

i tried to highlight the tr background color itself accourding to the
data retrived but with no luck, can any one help.


thank you


Replies

Replied 30 Nov 2007 20:56:01
30 Nov 2007 20:56:01 Pam Grimes replied:
Create styles for the color lines. Then use an If statement to assign the appropriate style, based on status.

<% Dim ProjStat
ProjStat = (st.Fields.Item("Status".Value) %>
<% If ProjStat = "Waiting" THEN %>
<tr class="waiting">
<% END IF %>

<% If ProjStat = "Complete" THEN %>
<tr class="complete">
<% END IF %>

Reply to this topic