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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop Dynamic results Horizontally 2

Status
Not open for further replies.

RobHat

Technical User
Nov 30, 2007
91
GB
Hi there I am hoping someone can shed some light on this for me, I have an SQL db which I want to display the data from horizontally on my page. Say 3 or 4 columns by however many rows. What tags and behaviours would I need to do this?

Rob
 
this should do it for you:

Code:
<cfquery name="qryData">
  your query
</cfquery>

<table border="0" cellpadding="0" cellspacing="0">
<tr>
  <cfoutput query="qryData">
    <td>#qryData.FieldName#</td>
      <cfif NOT (qryData.CurrentRow MOD 6)>
        </tr>
	<cfif qryData.CurrentRow NEQ qryData.RecordCount>
          <tr>
	</cfif>
      </cfif>
   </cfoutput>
</table>

Hope this helps!

Tony
 
Thanks for the help guys, I got this working.

Regards

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top