You can do something like this:

<table><tr>
  <cfoutput query="MyQuery">
     <td>#Division#</td>
   </cfoutput>
   </tr><tr>
  <cfoutput query="MyQuery">
    <td>#Program_Name#<td>
  </cfoutput>
  </tr></table>



  But, it doesn't give you the column span values.
  In your query you could add "Count(Division) as colspan" to get the 
colspan numbers, but then you'll have trouble with duplicates.  I can get 
it down to one database query and one query of a query:

  <cfquery name="Loop2">
     select Division, Program_Name from table
  </cfquery>

  <cfquery dbtype="query" name="Loop1">
    select Distinct Program_Name, Count(Division) as colspan from Loop2
   </cfquery>

  Then look similar to the way I Set up the above table:
<table><tr>
  <cfoutput query="Loop1">
     <td colspan="#loop1.colspan#>#loop1.Division#</td>
   </cfoutput>
   </tr><tr>
  <cfoutput query="Loop2">
    <td>#loop2.Program_Name#<td>
  </cfoutput>
  </tr></table>




At 10:33 AM 5/10/2002 -0400, you wrote:
>Hi Guys!
>
>How do I turn a CFQUERY record set that CFDUMPs like this:
>
><table border="1" cellspacing="0" cellpadding="1" bgcolor="#eeaaaa"
>bordercolor="Red">
>     <tr bgcolor="#eeaaaa" >
>
>          <td valign="top">DIVISION</td>
>
>          <td valign="top">PROGRAM_NAME</td>
>
>     </tr>
>     <tr> <td valign="top" bgcolor="#ffffff"> Team </td> <td valign="top"
>bgcolor="#ffffff"> Bear Street
></td> </tr> <tr> <td valign="top" bgcolor="#ffffff"> Team </td> <td
>valign="top" bgcolor="#ffffff">
>Clipboard Solutions </td> </tr> <tr> <td valign="top" bgcolor="#ffffff">
>Team </td> <td valign="top"
>bgcolor="#ffffff"> Emerson Associates </td> </tr> <tr> <td valign="top"
>bgcolor="#ffffff"> Team </td>
><td valign="top" bgcolor="#ffffff"> Lake Avenue </td> </tr> <tr> <td
>valign="top" bgcolor="#ffffff">
>Team </td> <td valign="top" bgcolor="#ffffff"> Smithfield road </td> </tr>
><tr> <td valign="top" bgcolor="#ffffff">
>Cambridge Health Alliance </td> <td valign="top" bgcolor="#ffffff"> The Beck
>Ward </td> </tr> <tr> <td
>valign="top" bgcolor="#ffffff"> North East </td> <td valign="top"
>bgcolor="#ffffff"> The Oliver Street
>House </td> </tr>
>     </table>
>
>into something like this:
>
><TABLE BORDER="1" CELLSPACING="0" CELLPADDING="1" BGCOLOR="#EEAAAA"
>BORDERCOLOR="Red">
>     <TR ALIGN="center">
>          <TD COLSPAN="5">Team</TD>
>          <TD COLSPAN="1">Cambridge Health Alliance</TD>
>          <TD COLSPAN="1">North East</TD>
>     </TR>
>     <TR ALIGN="center" BGCOLOR="#FFFFFF">
>          <TD COLSPAN="1">Bear Street</TD>
>          <TD COLSPAN="1">Clipboard Solutions</TD>
>          <TD COLSPAN="1">Emerson Associates</TD>
>          <TD COLSPAN="1">Lake Avenue</TD>
>          <TD COLSPAN="1">Smithfield road</TD>
>          <TD COLSPAN="1">The Beck Ward</TD>
>          <TD COLSPAN="1">The Oliver Street House</TD>
>     </TR>
></TABLE>
>
>I left the COLSPANs in there as a possible help to solving the general
>problem. I suspect there is a more eloquent solution than performing two or
>three subqueries, though. :-)
>
>Thanx
>
>Dave
>
>
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
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