You didn't signify what was not work in your code,
which without your database would make solving
your problem a little easier.

At first glance it looks like you should have your starting
and ending table tags outside of the query so you are not
making a new table for each row in the query result.
Another suggestion would be to use the below code
copied from teratech.com's ColdCuts in order to
display your items in 2 columns.

<table>
 <tr>
  <cfoutput query="getInfo">
   <td>#name#&lt;/td>
  <cfif getInfo.CurrentRow MOD 2 IS 0>
   </tr>
   <tr>
  </cfif>
</cfoutput>
</tr>
</table>

In the query you built I am having problems
visualizing your concept, but I usually use
a query with a grouping and then a loop query
for the items for each new record in the group.

Terry Troxel

----- Original Message -----
From: bajaria aslam <[EMAIL PROTECTED]>
To: CF-Talk <[EMAIL PROTECTED]>
Sent: Wednesday, August 22, 2001 10:45 AM
Subject: Displaying the query output in a table


> I have a query that joins two tables. Category and
> Items. I have the code that I am executing below also
> after the desired output display.I have to display the
> output in the following way:
>
>
> Category 1
> Item 1 Item 2
>
> Item 3 Item 4
>
> Item 5 Item 6
>
> Category 2
> Item 1 Item 2
>
> Category 3
> Item 1 Item 2
>
> Item 3
>
> Category 4
> Item 1
>
> Category 5
> Item 1 Item 2
>
> Here is the code that I have, which does not work
> properly
> <cfset CategoryNumber = 0>
> <cfoutput query="GetCategoryAndItems"
>                   group="CategoryID">
>
> <cfset CategoryNumber = CategoryNumber + 1>
>
>
> <table cellpadding=2 cellspacing=0 border=0
> width="100%">
>
> <tr colspan="2">
> <td bgcolor="a0b8c8"><font face="arial,helvetica"
> color="black" size=3><b>Category
> #CategoryNumber#</b></td>
> </tr>
>
>
> <cfset ItemNumber = 0>
>
>
> <cfoutput group="ItemID">
> <cfset ItemNumber = ItemNumber + 1>
> <cfif ItemNumber eq 1>
> <tr>
>
> </cfif>
>
> <td>
> Item #ItemNumber#<br>
> </td>
>
> <cfif ItemNumber eq 2>
> </tr>
>
> </cfif>
>
>
> </cfoutput>
>
>
> </table>
>
> </cfoutput>
>
> Any help is appreciated.
>
> A.B.
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to