sglee
asked on
Displaying Items in rows and columns
Hi,
As you can see in the screenshot, there are 4 items under "Featured Items". Actually there are 7 items in the ACCESS table, the rest has been cut off unfortunately. I like to be able to display three items per row repeatedly until it runs out of items to display.
My current CF Code is attached in CF-Code.txt
Can you help?
CF-Code.txt
As you can see in the screenshot, there are 4 items under "Featured Items". Actually there are 7 items in the ACCESS table, the rest has been cut off unfortunately. I like to be able to display three items per row repeatedly until it runs out of items to display.
My current CF Code is attached in CF-Code.txt
Can you help?
CF-Code.txt
can you just set a counter and count if it the counter is 3 then start new tr and reset and counter
Add a <CFIF statement to place the new row <TR> after every 3 columns... the CFIF may need a little playing with but this is the idea.
<TABLE width=880 border="0" cellpadding="1" cellspacing="1" align="center" >
<tr>
<td colspan=3 align="center"><BR><font size=4 color=ffffff>Featured Items
</td>
</tr>
<tr>
<td colspan="3"><br />
</td>
</tr>
<TR>
<cfoutput query="GetFeaturedItems">
<cfif getFeaturedItems.currentRow mod 3 eq 0><cfif getReaturedItems.currentRow gt 1></tr></cfif><tr></cfif>
<td align="center" >
<table border="0" Style="border:2px outset black;">
<tr>
<TD align="center" bgcolor="DDDDDD">
<table width="100%" border="0" align="center">
<tr>
<td bgcolor="005BA4" colspan="2" align="center" height="60px" width="220px">
<font color="ffffff"> <B>#Title#</B></font>
</td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="FFFFFF"><img border="0" width = "220" height="120" src="http://www.domainname.com/ImageUpload/#pic1#"><BR>
</td>
</tr>
<tr>
<td>
<b>Condition:
</td>
<td><font color="990000">#Condition#</font></b>
</td>
</tr>
<tr>
<td><b>Item No:</b>
</td>
<td>#numberformat(Price, "$(,.00)")#
</td>
</tr>
<tr>
<td colspan="2"><b>Description:
</td>
</tr>
<tr>
<td colspan="2"> <TEXTAREA NAME=Description ROWS=5 COLS=33 WRAP="VIRTUAL"><cfoutput>#GetFeaturedItems.Description#</cfoutput></TEXTAREA>
</td>
</tr>
</table>
</TD>
</tr>
</table>
</td>
</cfoutput>
</tr>
<TR><TD > </TD></TR>
<tr>
<!--<TD> </TD>-->
<td align="center"></td>
</tr>
<tr>
<TD colspan=3> </TD>
</tr>
<!--<tr>
<td colspan="3"><br />
</td>
</tr>-->
</table>
ASKER
@gdemaria
Let me try playing with the CFIF.
Let me try playing with the CFIF.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.