Created
July 26, 2016 17:55
-
-
Save anonymous/6ff04076185af165b7edf8348b7f1d19 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- create a sample query with the desired number of test rows ---> | |
<cfset rs = queryNew("")> | |
<cfset queryAddColumn(rs, "Summary", ["Summary 1","Summary 2","Summary 3","Summary 4", "Summary 5"])> | |
<cfoutput query="rs"> | |
<!--- Start new div when it is the 1st row in query OR first item in current group ---> | |
<cfif rs.currentRow EQ 1 OR rs.currentRow MOD 2 NEQ 0> | |
<div style="background-color: red;"> | |
</cfif> | |
<!--- display content here ---> | |
Row number [#rs.CurrentRow#] / Value = #rs.Summary#<br> | |
<!--- Close div when we've reached the last row in query OR the last item in current group ---> | |
<cfif rs.currentRow EQ rs.recordCount OR rs.currentRow MOD 2 EQ 0> | |
</div><br> | |
</cfif> | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment