Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New Columns Question

Status
Not open for further replies.

ctromb

Programmer
Jul 23, 2003
6
US
I understand displaying data in columns when it comes to recordcount and mutiple records in a database, but what If I need to display 25 fields in 5 columns from 1 record in my database.
 
Try something like this:

<table width=&quot;100%&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;>
<tr>
<cfparam name=&quot;attributes.TDcounter&quot; default=&quot;0&quot;>
<cfoutput query=&quot;whatever&quot;>
<td align=&quot;center&quot; valign=&quot;top&quot;>
#OutputStuffGoesHere#

<cfset attributes.TDcounter = attributes.TDcounter + 1>
<cfif attributes.TDcounter EQ 5>
</td>
</tr>
<tr>
<cfset attributes.TDcounter = 0>
<cfelse>
</td>
</cfif>
</cfoutput>
</tr>
</table>


This will basically output five columns, and then start a new row.

Hope this Helps!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top