Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Colour change based on query results!!! 1

Status
Not open for further replies.

RobHat

Technical User
Nov 30, 2007
91
GB
Hi guys me again, I have a table that displays a list of apartments, only text is displayed with a basic cfoutput. I have for each apartment the status ie. Available, Reserved or Sold.

I want the Available to be the same colour as the rest of the text but reserved to be green and sold to be red. I have found tutorials to alternate every rows colour but not depending on the exact result.

Rob
 
[red]<p[/red]
<CFIF Status IS 'Reserved'> style="color:green"
<CFELSEIF Status IS 'Sold'> style="color:red"</CFIF>[red]>
my apartment
</p>[/red]

r937.com | rudy.ca
 
he he, talk about looking to deeplt into it. I thought this was going to be something with a load of code and turns out to be something obvious. lol Thanks for the help.

Regards

Rob
 
Actually, I thought of one more refinement for ya! Why not sort (ORDER) the output of the query based on status, so that the colors are grouped together... just a thought?
 
Nice idea, would make it better for people viewing the stats aswell as they would easily identify whats sold, reserved or available. Thanks for the idea.

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top