Displaying Items in rows and columns

Item ListingHi,
 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
LVL 1
sgleeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

erikTsomikSystem Architect, CF programmer Commented:
can you just set a counter and count if it the counter is 3 then start new tr and reset and counter
0
gdemariaCommented:
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:&nbsp;&nbsp;
					   		   </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 >&nbsp;&nbsp;&nbsp;</TD></TR>
	<tr>
		<!--<TD>&nbsp;&nbsp;&nbsp;</TD>-->
	    <td align="center"></td>
	</tr>
	<tr>
		<TD colspan=3>&nbsp;&nbsp;&nbsp;</TD>
	</tr>
	<!--<tr>
	<td colspan="3"><br />
	</td>
	</tr>-->
</table>

Open in new window

0
sgleeAuthor Commented:
@gdemaria
Let me try playing with the CFIF.
0
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

sgleeAuthor Commented:
List Items@gdemaria
Having run the CFIF, I get the two items on first and last row.
0
gdemariaCommented:
How did playing with the CFIF go?  Any variations work?

Try putting the CFIF after the colums instead of before...

       <cfoutput query="GetFeaturedItems">
          <TR>
	      <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:&nbsp;&nbsp;
					   		   </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>
	       <cfif getFeaturedItems.currentRow mod 3 eq 0></tr><tr></cfif>
	   </cfoutput>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sgleeAuthor Commented:
List ItemsYes. Moving CFIF to where you suggested worked. Thank you.

                           </td>
                           </tr>            
                  </table>
             </TD>
          </tr>
         </table>
         </td>
<cfif GetFeaturedItems.currentRow mod 3 eq 0>
  <cfif GetFeaturedItems.currentRow gt 1>
     </tr>
  </cfif>
     <tr>
  </cfif>
         </cfoutput>
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.