This problem is similar to when creating alternate colour table-rows, only we are dealing with divs and margins instead of table rows and their colours.
The following code creates as many layers as there are genres returned from a query (if three genres are found, three layers are created); and within each layer created, the code creates as many layers as there are titles within that genre (for example, if there are five titles per genre, there will be three "genreName" layers, and inside each one there will be five "titleName" layers).
<cfoutput query="MyQuery" group="genreName">
<div class="Genres">
#MyQuery.GenreName#
<cfoutput>
<div class="Titles">
#MyQuery.TitleName#
<div>
</cfoutput>
</div>
</cfoutput>
This also means that all layers in each class are clones. If I have a columns layout where I do not want to assign a left/right margin to the first/last columns, this format breaks.
Is there a programmatic way to assign margins based on the layer number (record number, essentially) where I can apply conditional formatting (in this case, a left and right margin for the middle columns, and no left/right margins for first/last columns)?
Many thanks,