I think this will produce dodgy html. If the query is less than 4 you'll
never get the closing </tr>. Also, if the record count is not a multiple of
4 then you'll have a different number of <td></td> in the last row.

Of the top of my head, to fix the first problem, use this:

<cfif getSpecials.CurrentRow MOD 4 EQ 0 OR getSpecials.CurrentRow EQ
getSpecials.RecordCount>

instead of just:

<cfif getSpecials.currentRow MOD 4 eq 0>

To fix the second problem of padding out the last row with extra cells if it
needs it, try something like this:


<cfif getSpecials.CurrentRow MOD 4 EQ 0 OR getSpecials.CurrentRow EQ
getSpecials.RecordCount>
        <cfloop from="1" to="#getSpecials.CurrentRow MOD 4#" index="i">
                <td>&nbsp;</td>
        </cfloop>
        <tr>
</cfif>

Again that's just thinking quickly, it may be buggy.

Ade

-----Original Message-----
From: Eric Creese [mailto:[EMAIL PROTECTED]
Sent: 20 January 2005 16:55
To: CF-Talk
Subject: RE: Table Layout


Here is a little thing I do but the empty cell part I do not have.

<table>
        <tr>
        <cfoutput query="getSpecials">
                <td width="130" valign="top">
                        <center><img src="images/products/#largeimage#" 
border="0"></center>
                </td>
                <cfif getSpecials.currentRow MOD 4 eq 0>
        </tr>
        </cfif>
        </cfoutput>
</table>
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.2 - Release Date: 21/01/2005


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:191432
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to