Skip to main content
Participant
May 2, 2006
Answered

table, grey and white for every other record (row)

I have page that queries from a db and outputs records to a display page (html)
I want to know if I can have an output that shows a slight difference for every other row (record). For ex. First row would have the slightest grey color and the second row would have white color. This would repeat.
Thanks
What do I have to write.
Is this in html, cf?
Just like this cells below:
Just like the coldfusion forums page. (for clarity)








This topic is closed to new replies. Start a new post to keep the conversation going.
Dan_BracukCorrect answer
Inspiring
May 5, 2006
hi,
where do i put this code in
<td bgcolor="<cfif currentrow mod 2>##FFFFF<cfelse>##CCCCC</cfif>">#columname#</td>
or
<tr valign="top" bgcolor="iif(CurrentRow mod 2, de('white'), de('gray'))">

thanks

Something like this;
<table>
<tr>column headers</tr>
<cfoutut query="somequery">
<tr valign="top" bgcolor="iif(CurrentRow mod 2, de('white'), de('gray'))">
detail stuff
closing tags

4 replies

May 2, 2006
<td bgcolor="<cfif currentrow mod 2>##FFFFF<cfelse>##CCCCC</cfif>">#columname#</td>
Translate
Inspiring
May 3, 2006
Another way
<tr valign="top" bgcolor="iif(CurrentRow mod 2, de('white'), de('gray'))">
Translate
Participant
May 5, 2006
hi,
where do i put this code in
<td bgcolor="<cfif currentrow mod 2>##FFFFF<cfelse>##CCCCC</cfif>">#columname#</td>
or
<tr valign="top" bgcolor="iif(CurrentRow mod 2, de('white'), de('gray'))">

thanks
Translate