标题:ASP表格循环代码
取消只看楼主
jingfang_434
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2009-10-24
结帖率:37.5%
 问题点数:0 回复次数:1 
ASP表格循环代码
我这个代码想让商品列表变成2列的,怎么修改呢?请高手帮助
<%
set rs=server.createobject("adodb.recordset")
if bid="" then
sql="select * from pic order by id desc"
end if
if bid<>"" and sid="" then
sql="select * from pic where bigclassname='"&rsb("bigclassname")&"' order by id desc"
end if
if bid<>"" and sid<>"" then
sql="select * from pic where bigclassname='"&rsb("bigclassname")&"' and smallclassname='"&rss("smallclassname")&"' order by id desc"
end if
rs.open sql,conn,1,1
if rs.eof then
  Response.Write "<br><center>没有产品信息</center>"
  else
  counts=10
  rs.pagesize=counts
  allpages=rs.pagecount
  page=request("page")
  if not isnumeric(page) then page=1
  if isempty(page) or cint(page)<1 then
  page=1
  elseif cint(page)>=allpages then
  page=allpages
  end if
  rs.absolutepage=page
  end if
  do while (not rs.eof) and counts>0
%>        
         
         
          <TABLE
            style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; FLOAT: left; MARGIN: 5px 12px; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid"
            height=150 cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
                <TR>
                  <TD class=pl23 align=middle width=160 rowSpan=2><A
                  href="showproduct.asp?id=<%=rs("id")%>"><IMG
                  height=120 src="<%=rs("photo")%>"
                  width=150 border=0></A></TD>
                  <TD class=pla2
                style="PADDING-LEFT: 10px; FONT-SIZE: 12px; TEXT-ALIGN: left"
                height=40><A
                  style="FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #333333"
                  href="showproduct.asp?id=<%=rs("id")%>"><%=rs("title")%></A></TD>
                </TR>
                <TR>
                  <TD class=pl1a
                style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; FONT-SIZE: 12px; PADDING-BOTTOM: 10px; LINE-HEIGHT: 22px; PADDING-TOP: 10px"
                vAlign=top align=left><%=CutStrX(rs("content"),220)%></TD>
                </TR>
              </TBODY>
            </TABLE>
            
<%
    counts=counts-1
    rs.movenext
    if rs.eof then exit do
    loop
%>
搜索更多相关主题的帖子: where 
2015-01-05 15:43
jingfang_434
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2009-10-24
得分:0 
回复 2楼 hu9jj
试了,怎么显示成错位了啊
2015-01-06 08:54



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




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

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