主题:  使用CFOUTPUT输出多行多列

s22

职务:版主
等级:4
金币:10.0
发贴:1634
注册:2004/12/19 13:06:46
#12003/12/4 11:36:32
使用了query.next()方法,MM的文挡里没这个方法,但是确实可以使用
 <cfoutput query="getsub" maxrows="1"> 
  <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> 
    <tr align="center"> 
      <td><cfif getsub.recordcount gt 0 > 
          <cfif len(getsub.cate_image)> 
            <img src="#application.category.vpath##getsub.cate_image#" width="112" height="112"> 
            <cfelse> 
            <img src="../images/mm2.jpg" width="112" height="112"> 
          </cfif> 
        </cfif></td> 
      <td><cfif getsub.recordcount gt 1 and getsub.next() > 
          <cfif len(getsub.cate_image)> 
            <img src="#application.category.vpath##getsub.cate_image#" width="112" height="112"> 
            <cfelse> 
            <img src="../images/mm2.jpg" width="112" height="112"> 
          </cfif> 
        </cfif></td> 
      <td><cfif getsub.recordcount gt 2 and getsub.next()> 
          <cfif len(getsub.cate_image)> 
            <img src="#application.category.vpath##getsub.cate_image#" width="112" height="112"> 
            <cfelse> 
            <img src="../images/mm2.jpg" width="112" height="112"> 
          </cfif> 
        </cfif></td> 
    </tr> 
    <tr align="center"> 
      <td><cfif getsub.recordcount gt 3 and getsub.next()> 
          <cfif len(getsub.cate_image)> 
            <img src="#application.category.vpath##getsub.cate_image#" width="112" height="112"> 
            <cfelse> 
            <img src="../images/mm2.jpg" width="112" height="112"> 
          </cfif> 
        </cfif></td> 
      <td><cfif getsub.recordcount gt 4 and getsub.next()> 
          <cfif len(getsub.cate_image)> 
            <img src="#application.category.vpath##getsub.cate_image#" width="112" height="112"> 
            <cfelse> 
            <img src="../images/mm2.jpg" width="112" height="112"> 
          </cfif> 
        </cfif></td> 
      <td><cfif getsub.recordcount gt 5 and getsub.next()> 
          <cfif len(getsub.cate_image)> 
            <img src="#application.category.vpath##getsub.cate_image#" width="112" height="112"> 
            <cfelse> 
            <img src="../images/mm2.jpg" width="112" height="112"> 
          </cfif> 
        </cfif></td> 
    </tr> 
    <tr align="center"> 
      <td><cfif getsub.recordcount gt 6 and getsub.next()> 
          <cfif len(getsub.cate_image)> 
            <img src="#application.category.vpath##getsub.cate_image#" width="112" height="112"> 
            <cfelse> 
            <img src="../images/mm2.jpg" width="112" height="112"> 
          </cfif> 
        </cfif></td> 
      <td><cfif getsub.recordcount gt 7 and getsub.next()> 
          <cfif len(getsub.cate_image)> 
            <img src="#application.category.vpath##getsub.cate_image#" width="112" height="112"> 
            <cfelse> 
            <img src="../images/mm2.jpg" width="112" height="112"> 
          </cfif> 
        </cfif></td> 
      <td><cfif getsub.recordcount gt 8 and getsub.next()> 
          <cfif len(getsub.cate_image)> 
            <img src="#application.category.vpath##getsub.cate_image#" width="112" height="112"> 
            <cfelse> 
            <img src="../images/mm2.jpg" width="112" height="112"> 
          </cfif> 
        </cfif></td> 
    </tr> 
  </table> 
</cfoutput>						



s22

职务:版主
等级:4
金币:10.0
发贴:1634
注册:2004/12/19 13:06:46
#22003/12/4 11:43:36
更多未公开方法请访问
www.cfdev.com/mx/undocumentation/



54aft

职务:普通成员
等级:2
金币:1.0
发贴:657
注册:2002/8/26 17:11:53
#32003/12/4 22:42:41
是什么意思呀!能不能讲清楚点?



s22

职务:版主
等级:4
金币:10.0
发贴:1634
注册:2004/12/19 13:06:46
#42003/12/4 23:25:40
只是使用了一下一个未公开的方法,没什么.
可以不看.



雅痞公子

职务:普通成员
等级:3
金币:-3.0
发贴:732
注册:2003/3/27 23:16:34
#52003/12/5 0:32:23
那还是不用好,长长见识也好!