Thursday, May 24, 2007

OT: Boom!

Humbling, mesmerizing. Watching this can make a person view their life in a different light.

Anybody know what the song is?

Tuesday, May 22, 2007

Better alternating row colors

Occasionally you work something out to the point where it's good enough and you don't bother to go back and look at it again.

I thought I had done about all I could with alternating row colors by just doing a simple cfif before the rows started that picked a class for the row. It worked something like this:

--- in css file ---
.odd {background-color: #F7F7F7}
.even {background-color: #FFFFFF}

--- in code ---
<cfif myQuery.currentrow mod 2>
<cfset rowclass = "odd">
<cfset rowclass = "even">
<tr class="#rowclass#">

That seems to work ok, but here is a shorter way that seems to be just a little more elegant.

--- in css file ---
.row1 {background-color:#F7F7F7;}
.row0 {background-color:#FFFFFF;}

--- in code ---
<tr class="row#CurrentRow mod 2#">

That seems much better to me.