Skip to main content
Participating Frequently
March 17, 2010
Question

Color specific rows in detail section

  • March 17, 2010
  • 2 replies
  • 600 views

Hi,

   I would like to color a particular row in the detail section based on some values in the query.

For ex. I have 5 rows displayed, I would like to color the 3rd in red and the 5th row in green. My color code for red or green is in the query itself which renders the details section. I see a way to color the whole detail section but not a row.

Has someone attempted to do this in CF8, or is it even possible.

Thanks all for your time.

This topic has been closed for replies.

2 replies

Known Participant
March 22, 2010

usually i use this way to display different color for each detail...

hope it wil help...

<cfoutput query="RS_DATA_ROW">

        <tr>

          <cfset vi =  #RS_DATA_ROW.currentrow#>

          <CFSET V1 = TRIM(#RS_DATA_ROW.FIELD_1#)>

          <CFSET V2 = TRIM(#RS_DATA_ROW.FIELD_2#)>

            <cfset classJive = "blue">

            <cfif #vi# mod 2 eq 0 >

              <cfset classJive = "white">

            </cfif>

            <td valign="top" bgcolor="#classJive#">#V1#</td>

            <td valign="top" bgcolor="#classJive#"><div align="right">#V2#</div></td>

 

        </tr>

</cfoutput>

cfchick12Author
Participating Frequently
March 17, 2010

Hi all,

  Figured out a solution.

Place as many colored rectangle boxes over the column names and use the print when condition..property. If the query column has a color of red, print the red color box. Also make sure the query field name transparency value to transparent.

Thanks