I am trying to create a table that displays 4 results per row. The problem I am having is that I want the results to be centered within each row. For example, If I get 9 results for a query, a table is created with two rows of 4 results and a third row with the ninth result. This ninth result gets aligned to the left of the row and I would like it to be centered in the row. If this page was static I could just use a colspan to get the one cell on the third row to colspan 4 colums. I need a colspan that functions when a row has less than 4 results in it, and that will set the colspan according to the number of results that it has.
so if a row had two results a colspan of 2 for each result would make them centered to the rest of the table. How can I create a dynamic colspan that is able to do this?
Below is the code I have been using:
<cfoutput query="logo">
<td align="center"><img src="#SFileName#" border="0" alt="#Description#"></a></td>
<cfif gwpr.currentRow MOD 4 eq 0>
</tr><tr>
</cfif>
</cfoutput>
so if a row had two results a colspan of 2 for each result would make them centered to the rest of the table. How can I create a dynamic colspan that is able to do this?
Below is the code I have been using:
<cfoutput query="logo">
<td align="center"><img src="#SFileName#" border="0" alt="#Description#"></a></td>
<cfif gwpr.currentRow MOD 4 eq 0>
</tr><tr>
</cfif>
</cfoutput>