You could loop over the query like normal using cfloop and an index
variable, but only store the values in a structure, instead of outputting
them.  The last part of your loop will have a cfif to check if the current
row is even using the mod operator, like this:
<cfif i mod 2 eq 0>
and then in the cfif output your display code, using the variables you
stored above.  This will only output the display code every other row. The
last part of the cfif should reset the above structure.  Does this make
sense?

On 12/31/06, Greg Edmonds <[EMAIL PROTECTED]> wrote:
>
> Hello All,
>
> First of all, Happy New Year to all!!
>
> I'm struggling with outputting a query result.  I query the database and I
> want the output similar to below:
>
> <table border="1">
> <tr>
>   <td colspan="2">Header 1</td>
>   <td colspan="2">Header 2</td>
> </tr>
> <tr>
>   <td>Picture 1</td>
>   <td>Info 1</td>
>   <td>Picture 2</td>
>   <td>Info 2</td>
> </tr>
> <tr>
>   <td colspan="2">Icons 1</td>
>   <td colspan="2">Icons 2</td>
> </tr>
>   <tr>
>   <td colspan="2">Header 3</td>
>   <td colspan="2">Header 4</td>
> </tr>
> <tr>
>   <td>Picture 3</td>
>   <td>Info 3</td>
>   <td>Picture 4</td>
>   <td>Info 4</td>
> </tr>
> <tr>
>   <td colspan="2">Icons 3</td>
>   <td colspan="2">Icons 4</td>
> </tr>
> </table>
>
> To make it clearer, if I were to just output the query in a standard way,
> the following would result:
>
> Header 1
> Picture 1
> Info 1
> Icons 1
>
> Header 2
> Picture 2
> Info 2
> Icons 2
>
> Header 3
> Picture 3
> Info 3
> Icons 3
>
> Header 4
> Picture 4
> Info 4
> Icons 4
>
> Has anyone done this and would be willing to give me some tips on how to
> accomplish?  Any help would be greatly appreciated.  If I have not
> explained
> well enough let me know.
>
> Thanks,
> Greg
>
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265438
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to