Thanks Paul and Giles, I actually found that in order to get 3 rows I had to change the mod 3 to mod 4 as the first row was only allowing 2 columns then the second row had 3 columns. The code that works is:

<tr>
<cfoutput query="test">
<cfif test.currentrow mod 4 eq 0>
</tr><tr>
</cfif>
<td class="normal">
<input type="checkbox" name="test" value="#test#" class="field">#test#
</td>
</cfoutput>
</tr>


Thanks again.

Dave

At 14:57 1/22/2003 +0000, you wrote:

> I am having trouble remembering the exact syntax when using
> IIF.  I am
> outputting some records into a table format and I want to
> start a new row
> after every 3rd record.

I don't think this is suitable for IIF.  The reason being is that there are
3 possibilities for the rowcount... Ie start, end, middle.  IIF would be
fine if there were only 2 cells, as it's a yes or no type condition.

The way I would do it is that you have the loop, so start the first tr and
then after every 3, put in </tr><tr>

Easier in a cfif:

<tr>
<cfoutput query="test">
<cfif test.rowcount mod 3 eq 0>
        </tr><tr>
</cfif>
<td>
<!--- output the data into td's --->
</td>
</cfoutput>
</tr>

Make sense?

> Like so:
>
> <cfoutput query="test">
>       <tr><td>record 1</td><td>record 2</td><td>record 3</td></tr>
>       <tr><td>record 4</td><td>record 5</td> and so on.... </cfoutput>
>
> How do I setup the iif to do this?
>
> Thanks
>
> Dave

--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to