I am trying to output the following into 3 columns, the query returns a list of 
categories and their corresponding sub-categories. There is 27 categories in 
the list and like 400 subs. I cannot seem to get it. I appreciate the help!!


<!---GET ALL CATEGORIES AND THEIR CORRESPONDING SUB-CATEGORIES--->

<CFINVOKE 
 component="totallyclassified.components.commonQrys"
 method="InitAllMainSubCats"
 returnvariable="AllMainSubCatsRet">
 <CFINVOKEARGUMENT name="catStatus" value="1"/>
</CFINVOKE>

<!---GET A COUNT OF ALL CATEGORIES--->

<CFINVOKE 
 component="totallyclassified.components.commonQrys"
 method="InitCount"
 returnvariable="records">
  <CENTER>
    <TABLE border="0" cellpadding="2" CELLPSACING="2" width="980" 
style="border: 1px solid ##ccccee;">
      <CFOUTPUT query = "AllMainSubCatsRet" group="categoryID">
        <!--- Determine if this is record 1, 4, 7, etc...--->
        <!--- If so, open the row. --->
        <CFIF records.currentrow mod 3 is 1>
          <TR>
        </CFIF>
        <TD width="33%">
            <TABLE border="0" cellpadding="2" CELLPSACING="2" cols="2" 
width="98%">
              <TR>
                <TD colspan="2" class="sgrayfont" 
bgcolor="#APPLICATION.SILVERTABLE2#"><A href="##">#Trim(CategoryName)#</A></TD>
              </TR>
              <TR valign="TOP">
                <TD width="45%" valign="BOTTOM" height="21" 
class="sgrayfont"><A href="##">
                  <CFIF CategoryImage eq "0">
                    <IMG src="images/default-mcat.gif" border="0">
                    <CFELSE>
                    <IMG src="images/#Trim(CategoryImage)#" border="0">
                  </CFIF>
                  </A></TD>
                <TD width="55%" class="bblackfont">&nbsp;</TD>
              </TR>
            </TABLE>
          </CENTER></TD>
        <!--- Determine if this is record 3, 6, 9, etc... --->
        <!--- If so, close the row. --->
        <CFIF records.currentRow mod 3 IS 0>
          </TR>
          
        </CFIF>
      </CFOUTPUT>
      <!--- If the query record count is not equally divisible by 3, --->
      <!--- the last row was not close. --->
      <!--- Determine how many more columns are needed, create them --->
      <!--- and close the row. --->
      <CFIF records.recordCount mod 3 is not 0>
        <CFSET ColsLeft = 3 - (records.recordCount MOD 3)>
        <CFLOOP index = "i" from="1" to="#ColsLeft#">
          <TD>&nbsp;</TD>
        </CFLOOP>
        </TR>
        
      </CFIF>
    </TABLE>
  </CENTER>
<!--- END TEMPLATE --->


Doug B.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:265908
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to