Carl

this should get you out of trouble

////////////////////////////////
<cfset columns = 3>
<table>
        <tr>
                <cfoutput query="qryName">
                <!--- Put your data in this cell --->
                <td>Pic #currentRow#<br>Name #CurrentRow#</td>
                <cfif currentRow MOD columns EQ 0 AND currentRow NEQ recordCount>
        </tr>
        <tr>
                </cfif>
                <!--- If we have cells to populate, the populate them --->
                <cfif currentRow EQ recordCount AND currentRow NEQ 0>
                <cfset counter = recordCount>
                <cfloop condition="counter MOD columns NEQ 0">
                <td>&nbsp;</td>
                </cfloop>
                </cfif>
                </cfoutput>
</table>
//////////////////////////////////

Regards
Steve Onnis

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Carl
Vanderpal
Sent: Tuesday, June 08, 2004 6:23 PM
To: CFAussie Mailing List
Subject: [cfaussie] loop


Hello CFAussie,

Can someone help for my looping please...
What I want to do is if the RecordCount from the query is greater than
multiples of 3 then I want to start a new <tr>


Here is what I have got so far but it is not workingn the way I want.

<table border="0" cellpadding="5" cellpadding="0">
<cfset CountVar = 0>
<cfloop condition = "CountVar LESS THAN OR EQUAL TO 8">

<cfset CountVar = CountVar + 3>
<tr>
        <td>Pic <br> Name</td>
</tr>


</table>


Result: 8 Records

<table border="0" cellpadding="5" cellpadding="0">
<tr>
        <td>Pic 1 <br> Name 1</td>
        <td>Pic 2 <br> Name 2</td>
        <td>Pic 3 <br> Name 3</td>
</tr>

<tr>
        <td>Pic 4 <br> Name 4</td>
        <td>Pic 5 <br> Name 5</td>
        <td>Pic 6 <br> Name 6</td>
</tr>

<tr>
        <td>Pic 7 <br> Name 7</td>
        <td>Pic 8 <br> Name 8</td>
        <td>&nbsp;</td>
</tr>


</table>


Thanks

Best regards,
Carl Vanderpal
Po Box 3462 Dural, NSW 2158
mailto:[EMAIL PROTECTED]


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to