| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 371 人关注过本帖
标题:如何将显示方式由单列式改为三列式
只看楼主 加入收藏
zca26
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-9-10
收藏
 问题点数:0 回复次数:0 
如何将显示方式由单列式改为三列式
程序原来默认的显示方式是单列显示的,那样一个页面显得很空,所以想改成二行三列显示,但是修改了多次都没有成功,那位朋友知道的帮看一下! 多谢了
代码如下:
'=================================================
'过程名:ShowProduct
'=================================================
sub ShowProduct(TitleLen)
    if TitleLen<0 or TitleLen>200 then
        TitleLen=50
    end if
    if currentpage<1 then
           currentpage=1
    end if
    if (currentpage-1)*MaxPerPage>totalput then
        if (totalPut mod MaxPerPage)=0 then
               currentpage= totalPut \ MaxPerPage
        else
               currentpage= totalPut \ MaxPerPage + 1
        end if
       end if
    if currentPage=1 then
        sqlProduct="select top " & MaxPerPage   
    else
        sqlProduct="select "
    end if

    sqlProduct=sqlProduct & " ID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,Price,Spec,Unit,Memo,DefaultPicUrl,UpdateTime,Hits from chanpin where Passed=True "
   
    if BigClassName<>"" then
        sqlProduct=sqlProduct & " and BigClassName='" & BigClassName & "' "
        if SmallClassName<>"" then
            sqlProduct=sqlProduct & " and SmallClassName='" & SmallClassName & "' "
        end if
    end if
    sqlProduct=sqlProduct & " order by UpdateTime desc"
    Set rsProduct= Server.CreateObject("ADODB.Recordset")
    rsProduct.open sqlProduct,conn,1,1
    if rsProduct.bof and  rsProduct.eof then
        response.Write("<br><li>没有任何产品</li>")
    else
        if currentPage=1 then
            call ProductContent(TitleLen)
        else
            if (currentPage-1)*MaxPerPage<totalPut then
                    rsProduct.move  (currentPage-1)*MaxPerPage
                 dim bookmark
                   bookmark=rsProduct.bookmark
                call ProductContent(TitleLen)
            else
                currentPage=1
                   call ProductContent(TitleLen)
            end if
        end if
    end if
    rsProduct.close
    set rsProduct=nothing
end sub

sub ProductContent(intTitleLen)
       dim i,strTemp
    i=0
    do while not rsProduct.eof
        strTemp=""        
        strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
                strTemp= strTemp & "<tr>"
                strTemp= strTemp & "<td width=25% rowspan=6>"

               
                strTemp= strTemp & "<div align=center><a href=Product2.asp?BigClassName=" & rsProduct("Title") &">"         
                fileExt=lcase(getFileExtName(rsProduct("DefaultPicUrl")))
                if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then
                strTemp= strTemp & "<img style='BORDER-LEFT-COLOR: #cccccc; BORDER-BOTTOM-COLOR: #cccccc; BORDER-TOP-COLOR: #cccccc; BORDER-RIGHT-COLOR: #cccccc' src=" & rsProduct("DefaultPicUrl") & " width=105 height=80 onload='javascript:DrawImage(this);'>"
                else
                 if fileext="swf" then
                    strTemp= strTemp & "<object  classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'  codebase='http://download.,0,0,0' width='105' height='84'>"
                    strTemp= strTemp &"<param name=movie value='"&rsProduct("DefaultPicUrl")&"'>"
                    strTemp= strTemp &"<param name=quality value=high>"
                    strTemp= strTemp &"<param name='Play' value='-1'>"
                    strTemp= strTemp &"<param name='Loop' value='0'>"
                    strTemp= strTemp &"<param name='Menu' value='-1'>"                    
                    strTemp= strTemp &"<embed  src='"&rsProduct("DefaultPicUrl")&"' width='105' height='84' pluginspage='http://www.' type='application/x-shockwave-flash'></embed> </object>"                                                
               end if
              end if                              
                strTemp= strTemp & "</a></div></td>"   
               

                strTemp= strTemp & "<td width=12% height=12>"
                strTemp= strTemp & "&nbsp;&nbsp;&nbsp;&nbsp;</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & "<a class=font1 href=Product2.asp?BigClassName=" & rsProduct("Title") &">" & rsProduct("Title") & ""
                strTemp= strTemp & "</a></td>"   
                    
               
                'strTemp= strTemp & "</tr><tr>"
                'strTemp= strTemp & "<td width=12% height=12>"
                'strTemp= strTemp & "产品售价:</td>"
                'strTemp= strTemp & "<td>" & rsProduct("Price") & "元</td>"            
                strTemp= strTemp & "</tr><tr>"                                    
                strTemp= strTemp & "</tr><tr>"                           
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td height=12>"
                strTemp= strTemp & "</td>"  
                strTemp= strTemp & "</tr><tr>"                        
                strTemp= strTemp & "<td height=12></td>"
                strTemp= strTemp & "<td>"


                strTemp= strTemp & "<a href=Product2.asp?BigClassName=" & rsProduct("Title") &" target=_blank><img src=Img/arrow_7.gif border=0></a></td>"


                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td colspan=2>"
                strTemp= strTemp & "<table width=100% border=0 cellpadding=0 cellspacing=0>"
                strTemp= strTemp & "<tr>"
                strTemp= strTemp & "<td width=50% height=12>"
                strTemp= strTemp & "<div align=center></div></td>"
               
                'strTemp= strTemp & "<td width=50% height=12>"
                'strTemp= strTemp & "<div align=center><input name='Product_Id' type='checkbox'    id='Product_Id' value="&cstr(rsProduct("Product_Id"))&"> 选取"
                'strTemp= strTemp & "</div></td>"        
                strTemp= strTemp & "</tr>"
                strTemp= strTemp & "</table>"
                strTemp= strTemp & "</td>"
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td height=1 colspan=3 bgcolor=#CCCCCC></td>"
                strTemp= strTemp & "</tr>"
                strTemp= strTemp & "</table>"
        response.write strTemp
        rsProduct.movenext
        i=i+1
        if i>=MaxPerPage then exit do   
    loop
end sub
搜索更多相关主题的帖子: 单列 
2010-09-10 18:16
快速回复:如何将显示方式由单列式改为三列式
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023044 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved