请教ASP高手一行多列显示问题 20
我要显示的效果如下产品一产品二产品三产品四产品五产品六...下面的代码只显示一列。请高手帮我改下。谢谢!<!--#includefile="../include/conn...
我要显示的效果如下
产品一 产品二 产品三
产品四 产品五 产品六
...
下面的代码只显示一列。请高手帮我改下。谢谢!
<!--#include file="../include/connstr.asp"-->
<!--#include file="../include/DefFunction.asp"-->
<%
PageNo=request("PageNo")
CateName=request("CateName")
if request("CateID")="" then
CateID=0
CateName="全部产品"
else
CateID=request("CateID")
end if
Key=request("Key")
%>
<%'----------------------------
PERPAGE =9
set rs=server.CreateObject("adodb.recordset")
if Key<>"" and CateID<>"" then '如果关键和产品类别都有的同时,筛选产品集
sql="select * from tProduct where StateFlag=0 and (CateID="&CateID&" or Title like '%"&Key&"%' or Content like '"&Content&"') order by AddTime desc"
else if Key<>"" then '如果只是关键的时
sql="select * from tProduct where StateFlag=0 and (Title like '%"&Key&"%' or Content like '"&Content&"') order by AddTime desc"
else if CateID="-1" then '推荐产品
sql="select * from tProduct where IsHot=1 and StateFlag=0 order by AddTime desc"
else if CateID="-2" then '库存产品
sql="select * from tProduct where IsHot=2 and StateFlag=0 order by AddTime desc"
else if CateID="0" then
sql="select * from tProduct where StateFlag=0 order by AddTime desc"
else
sql="select * from tProduct where CateID="&CateID&" and StateFlag=0 order by AddTime desc"
end if
end if
end if
end if
end if
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
rs.pagesize = PERPAGE
if isempty(PageNo) or cstr(PageNo)<"1" then PageNo = 1
CurPage=PageNo
if int(PageNo)>=int(rs.pagecount) then CurPage=cint(rs.pagecount)
rs.absolutepage = CurPage
for i = 1 to rs.pagesize
%>
<tr>
<td><table width="33%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td align="center"><a href="javascript:newWindow('/Product/ShowProduct.asp?ID=<%=rs("ID")%>','culture','713','583','')"> </a>
<table width="99%" border="0" cellspacing="0" cellpadding="0">
应该是多行多列显示问题。
现在的效果是这样的
产品一
产品二
...
我现在想达到一行可以显示多列请问下怎么改呢?非常感谢高手能指点下。 展开
产品一 产品二 产品三
产品四 产品五 产品六
...
下面的代码只显示一列。请高手帮我改下。谢谢!
<!--#include file="../include/connstr.asp"-->
<!--#include file="../include/DefFunction.asp"-->
<%
PageNo=request("PageNo")
CateName=request("CateName")
if request("CateID")="" then
CateID=0
CateName="全部产品"
else
CateID=request("CateID")
end if
Key=request("Key")
%>
<%'----------------------------
PERPAGE =9
set rs=server.CreateObject("adodb.recordset")
if Key<>"" and CateID<>"" then '如果关键和产品类别都有的同时,筛选产品集
sql="select * from tProduct where StateFlag=0 and (CateID="&CateID&" or Title like '%"&Key&"%' or Content like '"&Content&"') order by AddTime desc"
else if Key<>"" then '如果只是关键的时
sql="select * from tProduct where StateFlag=0 and (Title like '%"&Key&"%' or Content like '"&Content&"') order by AddTime desc"
else if CateID="-1" then '推荐产品
sql="select * from tProduct where IsHot=1 and StateFlag=0 order by AddTime desc"
else if CateID="-2" then '库存产品
sql="select * from tProduct where IsHot=2 and StateFlag=0 order by AddTime desc"
else if CateID="0" then
sql="select * from tProduct where StateFlag=0 order by AddTime desc"
else
sql="select * from tProduct where CateID="&CateID&" and StateFlag=0 order by AddTime desc"
end if
end if
end if
end if
end if
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
rs.pagesize = PERPAGE
if isempty(PageNo) or cstr(PageNo)<"1" then PageNo = 1
CurPage=PageNo
if int(PageNo)>=int(rs.pagecount) then CurPage=cint(rs.pagecount)
rs.absolutepage = CurPage
for i = 1 to rs.pagesize
%>
<tr>
<td><table width="33%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td align="center"><a href="javascript:newWindow('/Product/ShowProduct.asp?ID=<%=rs("ID")%>','culture','713','583','')"> </a>
<table width="99%" border="0" cellspacing="0" cellpadding="0">
应该是多行多列显示问题。
现在的效果是这样的
产品一
产品二
...
我现在想达到一行可以显示多列请问下怎么改呢?非常感谢高手能指点下。 展开
1个回答
展开全部
一次发不了那么多接上<tr align="left">
<td width="22%" colspan="3"><div align="center"><a href="javascript:newWindow('/cdweb/Product/ShowProduct.asp?ID=<%=rs("ID")%>','culture','713','583','')"><img width="120" height="120" border="0" <%if trim(rs("ProductPic"))="" or isnull(rs("ProductPic")) then response.write "src=/UploadFile/default.gif" else response.write "src=/UploadFile/ProductFile/"&rs("ProductPic")&" width='100'"%>></a></div></td>
</tr>
<tr align="left">
<td height="20" colspan="3"><div align="center"><font color="#000000">产品名称:<a href="javascript:newWindow('/cdweb/Product/ShowProduct.asp?ID=<%=rs("ID")%>','culture','713','583','')"><%=rs("Title")%></a></font></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="1" align="center" bgcolor="#cccccc"></td>
</tr>
</table></td><% if i mod 3=0 then%>
</tr>
<%end if
rs.movenext
if rs.eof then
i = i + 1
exit for
end if
next %>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td><font color="#000000">页次:<b><%=CurPage%></b>/<b><%=rs.pagecount %></b>页 共<b><%=rs.recordcount %></b>条记录</font></td>
<td align="right">
<%
if CurPage = 1 then
response.write " 首页 | 上一页 | "
else
response.write "<a href='?PageNo=1&Key="&Key&"&CateID="&CateID&"&CateName="&CateName&"'><b> 首页 </b></a> | <a href='?PageNo="&CurPage-1&"&Key="&Key&"&CateID="&CateID&"&CateName="&CateName&"'><b>上一页</b></a>| "
end if
if CurPage = rs.pagecount then
response.write "后一页 | 尾页 "
else
response.write "<a href='?PageNo="&CurPage+1&"&Key="&Key&"&CateID="&CateID&"&CateName="&CateName&"'><b>后一页</b> </a>| <a href='?PageNo="&rs.pagecount&"&Key="&Key&"&CateID="&CateID&"&CateName="&CateName&"'><b>尾页</b> </a>"
end if
%>
跳转到:
<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<% for i=1 to rs.pagecount
if cstr(CurPage)=cstr(i) then
response.write "<option value='?PageNo="&i&"&Key="&Key&"&CateID="&CateID&"&CateName="&CateName&"' selected>第"&i&"页</option>"
else
response.write "<option value='?PageNo="&i&"&Key="&Key&"&CateID="&CateID&"&CateName="&CateName&"'>第"&i&"页</option>"
end if
next
%>
</select>
</td>
</tr>
</table></td>
</tr>
<%else%>
<tr>
<td align="center" colspan=5 height="296"><font color="ff0000"><b>暂时没有该系列产品!</b></font></td>
</tr>
<% end if %>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
<td width="22%" colspan="3"><div align="center"><a href="javascript:newWindow('/cdweb/Product/ShowProduct.asp?ID=<%=rs("ID")%>','culture','713','583','')"><img width="120" height="120" border="0" <%if trim(rs("ProductPic"))="" or isnull(rs("ProductPic")) then response.write "src=/UploadFile/default.gif" else response.write "src=/UploadFile/ProductFile/"&rs("ProductPic")&" width='100'"%>></a></div></td>
</tr>
<tr align="left">
<td height="20" colspan="3"><div align="center"><font color="#000000">产品名称:<a href="javascript:newWindow('/cdweb/Product/ShowProduct.asp?ID=<%=rs("ID")%>','culture','713','583','')"><%=rs("Title")%></a></font></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="1" align="center" bgcolor="#cccccc"></td>
</tr>
</table></td><% if i mod 3=0 then%>
</tr>
<%end if
rs.movenext
if rs.eof then
i = i + 1
exit for
end if
next %>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td><font color="#000000">页次:<b><%=CurPage%></b>/<b><%=rs.pagecount %></b>页 共<b><%=rs.recordcount %></b>条记录</font></td>
<td align="right">
<%
if CurPage = 1 then
response.write " 首页 | 上一页 | "
else
response.write "<a href='?PageNo=1&Key="&Key&"&CateID="&CateID&"&CateName="&CateName&"'><b> 首页 </b></a> | <a href='?PageNo="&CurPage-1&"&Key="&Key&"&CateID="&CateID&"&CateName="&CateName&"'><b>上一页</b></a>| "
end if
if CurPage = rs.pagecount then
response.write "后一页 | 尾页 "
else
response.write "<a href='?PageNo="&CurPage+1&"&Key="&Key&"&CateID="&CateID&"&CateName="&CateName&"'><b>后一页</b> </a>| <a href='?PageNo="&rs.pagecount&"&Key="&Key&"&CateID="&CateID&"&CateName="&CateName&"'><b>尾页</b> </a>"
end if
%>
跳转到:
<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<% for i=1 to rs.pagecount
if cstr(CurPage)=cstr(i) then
response.write "<option value='?PageNo="&i&"&Key="&Key&"&CateID="&CateID&"&CateName="&CateName&"' selected>第"&i&"页</option>"
else
response.write "<option value='?PageNo="&i&"&Key="&Key&"&CateID="&CateID&"&CateName="&CateName&"'>第"&i&"页</option>"
end if
next
%>
</select>
</td>
</tr>
</table></td>
</tr>
<%else%>
<tr>
<td align="center" colspan=5 height="296"><font color="ff0000"><b>暂时没有该系列产品!</b></font></td>
</tr>
<% end if %>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询