标题:asp技术求教,如何实现图片横向排列
只看楼主
nzoey
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2010-3-17
结帖率:0
已结贴  问题点数:20 回复次数:3 
asp技术求教,如何实现图片横向排列
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 & " * from Product 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,ViewList
         i=1
         ViewList=1
        strTemp=""
        strtemp= strtemp & "<p>"
        strTemp= strTemp & "<TABLE align=left  BORDER=0 CELLSPACING=1 CELLPADDING=0>"
        strTemp= strTemp & "<tr>"
    do while not rsProduct.eof
     strTemp= strTemp & "<td width=680 >"               
   strTemp= strTemp &"<TABLE align=left border=0 cellPadding=0 cellSpacing=0 >"
   strTemp= strTemp &"<TR> "
   strTemp= strTemp & "<td width=195 align=left valign=top>"
   strTemp= strTemp & "   <table width=168 border=0 cellpadding=0 cellspacing=4 bgcolor=#E6E6E6><tr><td bgcolor=#FFFFFF>"
   strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("id") & ">" & "<img src=" & rsProduct("DefaultPicUrl") & " width='160' height='120' border='0' >" & "</a><br>"  
      strTemp= strTemp & "</td></tr></table>"
      strTemp= strTemp & "</td>"
      strTemp= strTemp & "<td width=480 align=left valign=top>"
      strTemp= strTemp & "<table width=100% height=20 border=0 cellpadding=0 cellspacing=0><tr>"
      strTemp= strTemp & "<td width=7% ><img src=images/index_05.gif width=11 height=11 /></td><td width=93% class=b12b>"
      strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("id") & ">" & rsProduct("Title") & ""
      strTemp= strTemp & "</a></td></tr></table>"
      
      strTemp= strTemp & "<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=60><span class=b12>"
      strTemp= strTemp &  rsProduct("Content") & ""
      strTemp= strTemp & "</span><br /><span class=g12>完成日期:"
      
      strTemp= strTemp  & FormatDateTime(rsProduct("updateTime"),2) & ""
      strTemp= strTemp & "</span></td></tr></table>"
      strTemp= strTemp & "<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=5></td></tr></table>"
      strTemp= strTemp & "<table width=180 border=0 cellspacing=0 cellpadding=0><tr>"
      strTemp= strTemp & "<td width=97>"& "<a href=ProductShow.asp?ID=" & rsProduct("id") & ">" & "<img src=images/cases_04.gif name=Image10 width=83 height=22 border=0 id=Image10 /></a></td>"
      strTemp= strTemp & "<td width=83>"& "<a href=" & rsProduct("Memo") & " target=_blank>" & "<img src=images/cases_05.gif name=Image11 width=83 height=22 border=0 id=Image11 /></a></td>"

                        
   strTemp= strTemp &"</tr></table>"   
                     
                  




   strTemp= strTemp &"</td>"   
   strTemp= strTemp &"</TR>"   
   strTemp= strTemp &"<tr><td height=35 background=images/line_01.gif colspan=2></td></tr>"
   
   strTemp= strTemp &"</TABLE>"
   
        if i mod ViewList =0 then
           strTemp= strTemp & "</td></tr>"
        end if
           rsProduct.MoveNext      
        i=i+1
        if i>MaxPerPage then exit do            
    loop
        strtemp= strtemp & "</tr></table>"
        response.write strTemp  
end sub
请各位大哥帮忙
搜索更多相关主题的帖子: 技术 asp 排列 
2010-03-17 13:29
nzoey
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2010-3-17
得分:0 
横向排列,去掉图片右边的字,3个每行。
2010-03-17 13:32
nzoey
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2010-3-17
得分:0 
新手求教,请各位大大指点
2010-03-17 13:37
sunfishy
Rank: 3Rank: 3
等 级:论坛游侠
威 望:5
帖 子:311
专家分:163
注 册:2007-6-29
得分:20 
你自己不已经写好了吗.

把viewlist=1改成viewlist=3就是每行三张图了.

.cn
2010-03-17 14:56



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-299695-1-1.html




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

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