Skip to content

Instantly share code, notes, and snippets.

Created July 26, 2016 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6ff04076185af165b7edf8348b7f1d19 to your computer and use it in GitHub Desktop.
Save anonymous/6ff04076185af165b7edf8348b7f1d19 to your computer and use it in GitHub Desktop.
TryCF Gist
<!--- 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