getfoo is right...

Not sure if this has already been fixed, but the <cfloop...> tags need to be 
INside the table tags, so each iteration in the loop creates a new row, not a 
new table.

Also, not sure what the purpose of the "cfif currentrow LTE recordcount" is 
for. The loop will end when the recordset is done, so this is redundant.

Not sure why they want to show the next row on the current row. Doesn't make 
sense at all. Especially since it's set to happen every other row... unless 
they were trying to do something like this, putting two names per line?

        <cfif (currentrow mod 2 EQ 0) or (currentrow EQ recordcount)>   
        <!--- <td>#getFoo.fname# #getFoo.lname#</td> --->
        <cfelse>
        <td>#getFoo.fname# #getFoo.lname#</td>
        <td>#getFoo.fname[currentrow+1]# #getFoo.lname[currentrow+1]#</td>
        </cfif>

Mik


At 05:36 PM 5/17/2007, Bobby Hartsfield wrote:
>Without fixed widths on the cells, they aren’t going to line up in separate
>tables
>
>-----Original Message-----
>From: Christopher Chin [mailto:[EMAIL PROTECTED] 
>Sent: Thursday, May 17, 2007 4:55 PM
>To: CF-Talk
>Subject: Re: cfloop output into columns - help
>
>OK..I have a new issue with the HTML.  My designer just changed the layout
>on me and I'm having a hard time with the logic for the html.
>
>Here is my code:
><cfquery name="getFoo" datasource="employees">
> select * from employees where fname like 'chris%' order by fname, lname
></cfquery>
>
><cfloop query="getFoo">
><table border="1">
>   <tr>
>     <cfif currentrow LTE recordcount>
>        <cfif (currentrow mod 2 EQ 0) or (currentrow EQ recordcount)>   
>        <td>#getFoo.fname# #getFoo.lname#</td>
>        <cfelse>
>        <td>#getFoo.fname# #getFoo.lname#</td>
>        <td>#getFoo.fname[currentrow+1]# #getFoo.lname[currentrow+1]#</td>
>        </cfif>
>     </cfif>
>   </tr>
></table>
></cfloop>
>
>The difference now is that there's one table per record in the query.  the
>table has either 1 or 2 columns based on the # of results.
>
>see it in action here: http://www.christopherchin.com/cflooptest2.cfm
>
>any help with the logic is much appreciated :O)
>
>thanx!
>Chris

--------
Michael Muller
Admin, MontagueMA.net Website
work (413) 863-0030
cell (413) 320-5336
skype: michaelBmuller
http://www.MontagueMA.net

Eschew Obfuscation




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & 
Flex 2
Free Trial 
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278526
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to