1 Reply Latest reply on Feb 5, 2009 9:40 AM by Dan Bracuk

    hi wanna display as 3 in table row

    newchickinCF Level 1
      Hi, Still in categories and subcategories: my below component is displaying the code as tree menu:

      <cfcomponent name="Categories">
      <cffunction name="getCats">
      <!--- Parent ID --->
      <cfargument name="parent" type="numeric">
      <!--- Query for Children of Parent --->
      <cfquery name="cats" datasource="#request.dsn#">
      WHERE parentid = <cfqueryparam cfsqltype="cf_sql_numeric" value="#arguments.parent#">
      <!--- Create Output --->
      <cfif cats.recordcount GT 0>
      <cfset output = "<ul>">
      <!--- Loop over all items --->
      <cfloop query="cats">
      <cfset output = "#output# <li><a href='a.cfm?id=#cats.catID#'>#cats.category#</a>">
      <!--- Check Children of this item --->
      <cfif cats.recordcount GT 0>
      <cfset output = "#output# #CreateObject('component', 'wrap').getCats(cats.catid)#">
      <cfset output = "#output#</li>">
      <cfset output = "#output#</ul>">
      <cfreturn output />

      And what i was tryng is that for every category a <td> should be created and then i should add something like <cfif query.currentRow MOD 3>

      it should move to the next <td> TAG.

      Till Here but the problem is i am trying to doin may be say stupid way.

      under category in one <TD> if that category have subcats. then it should display them as ul and li. and like this:

      i created a table generation but getting into problems while plugging it in the cfc:

      here is of my auto table generation:

      <table align="center" width="100%" border="0">
      <cfif variables.newrow EQ true>
      <td>My CFC Code Goes Here</td>
      <cfif query.currentRow MOD 4 EQ 0>
      <cfset variables.newrow = true>
      <cfset variables.newrow = false>