asp 现在这个一行显示一个,如何让产品一行显示三个呢?请教下。
<linkhref="css/body.css"rel="stylesheet"type="text/css"/><%ssql="select*fromproductwh...
<link href="css/body.css" rel="stylesheet" type="text/css" />
<%
ssql = "select * from product where 1=1 "
if request("classid")<>"" then
dim classs
classs = request("classid")
isnum(classs)
bigclass = request("bigclass")
isnum(bigclass)
if bigclass = classs then
ssql = ssql&"and class in (select id from ppclass where followid="&bigclass&") "
if oconn.execute("select count(id) from ppclass where followid="&bigclass)(0) = 0 then
ssql = ssql & " or class = "&bigclass&" "
end if
else
ssql = ssql&"and class = "&classs&" "
end if
end if
if request("proname")<>"" then
dim proname
proname = request("proname")
ssql = ssql&"and D_title like '%"&proname&"%' "
end if
if request("pronum")<>"" then
dim pronum
pronum = request("pronum")
ssql = ssql&"and number like '%"&pronum&"%' "
end if
ssql = ssql&"order by date"
'response.Write(ssql)
ors.open ssql,oconn,3,3
ors.PageSize=9 ' PageSize 属性:显示 Recordset 对象每一页显示的记录数
dim page
Page=Cint(Request.QueryString("Page")) '转换成短整形Integer
if Page<1 then Page=1 '不足1页时,设定为1页
'PageCount 属性:显示 Recordset 对象包括多少“页”的数据
if Page>ors.PageCount Then Page=ors.PageCount 'Page比总页数还大时,设定为最后1页,即总页数。
if Page<>1 then '即大于第1页,小于最后1页
end if
If Not oRs.Eof Then
ors.AbsolutePage = Page 'AbsolutePage属性:设定当前记录的位置是位于哪一页?
dim i
for i=1 to ors.PageSize
%>
<table width="190" height="322" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="194" height="30" align="left" class="hongen"><%=left(ors("D_title"),13)%>...</td>
</tr>
<tr>
<td height="182" align="center" valign="middle" bgcolor="#FFFDF9"><a href="productshow.asp?id=<%=ors("D_id")%>" target="_blank"><img src="<%=ors("D_Picture")%>" alt="" width="160" height="160" border="0" onload="javascript:if(this.height>this.width){this.height=160}else{this.width=160};" /></a></td>
</tr>
<tr>
<td class="huiziti" align="left"><table width="165" height="11" border="0" align="center" cellpadding="0" cellspacing="0" class="gao2">
<tr>
<td> </td>
</tr>
</table>
<table width="175" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><a href="productshow.asp?id=<%=ors("D_id")%>" target="_blank" class="new"><%=left(ors("number"),80)%>...</a></td>
</tr>
</table>
</td>
</tr>
</table>
<%
ors.Movenext
if ors.eof then exit For
next
Else
Response.Write "现在数据库中还没有数据!"
End If
%>
</tr>
</table>
<br> 展开
<%
ssql = "select * from product where 1=1 "
if request("classid")<>"" then
dim classs
classs = request("classid")
isnum(classs)
bigclass = request("bigclass")
isnum(bigclass)
if bigclass = classs then
ssql = ssql&"and class in (select id from ppclass where followid="&bigclass&") "
if oconn.execute("select count(id) from ppclass where followid="&bigclass)(0) = 0 then
ssql = ssql & " or class = "&bigclass&" "
end if
else
ssql = ssql&"and class = "&classs&" "
end if
end if
if request("proname")<>"" then
dim proname
proname = request("proname")
ssql = ssql&"and D_title like '%"&proname&"%' "
end if
if request("pronum")<>"" then
dim pronum
pronum = request("pronum")
ssql = ssql&"and number like '%"&pronum&"%' "
end if
ssql = ssql&"order by date"
'response.Write(ssql)
ors.open ssql,oconn,3,3
ors.PageSize=9 ' PageSize 属性:显示 Recordset 对象每一页显示的记录数
dim page
Page=Cint(Request.QueryString("Page")) '转换成短整形Integer
if Page<1 then Page=1 '不足1页时,设定为1页
'PageCount 属性:显示 Recordset 对象包括多少“页”的数据
if Page>ors.PageCount Then Page=ors.PageCount 'Page比总页数还大时,设定为最后1页,即总页数。
if Page<>1 then '即大于第1页,小于最后1页
end if
If Not oRs.Eof Then
ors.AbsolutePage = Page 'AbsolutePage属性:设定当前记录的位置是位于哪一页?
dim i
for i=1 to ors.PageSize
%>
<table width="190" height="322" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="194" height="30" align="left" class="hongen"><%=left(ors("D_title"),13)%>...</td>
</tr>
<tr>
<td height="182" align="center" valign="middle" bgcolor="#FFFDF9"><a href="productshow.asp?id=<%=ors("D_id")%>" target="_blank"><img src="<%=ors("D_Picture")%>" alt="" width="160" height="160" border="0" onload="javascript:if(this.height>this.width){this.height=160}else{this.width=160};" /></a></td>
</tr>
<tr>
<td class="huiziti" align="left"><table width="165" height="11" border="0" align="center" cellpadding="0" cellspacing="0" class="gao2">
<tr>
<td> </td>
</tr>
</table>
<table width="175" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><a href="productshow.asp?id=<%=ors("D_id")%>" target="_blank" class="new"><%=left(ors("number"),80)%>...</a></td>
</tr>
</table>
</td>
</tr>
</table>
<%
ors.Movenext
if ors.eof then exit For
next
Else
Response.Write "现在数据库中还没有数据!"
End If
%>
</tr>
</table>
<br> 展开
1个回答
展开全部
你这问题问得有点奇怪。要看整页代码。
给你改了一下,估计是你外表格的宽度太小了
<link href="css/body.css" rel="stylesheet" type="text/css" />
<%
ssql = "select * from product where 1=1 "
if request("classid")<>"" then
dim classs
classs = request("classid")
isnum(classs)
bigclass = request("bigclass")
isnum(bigclass)
if bigclass = classs then
ssql = ssql&"and class in (select id from ppclass where followid="&bigclass&") "
if oconn.execute("select count(id) from ppclass where followid="&bigclass)(0) = 0 then
ssql = ssql & " or class = "&bigclass&" "
end if
else
ssql = ssql&"and class = "&classs&" "
end if
end if
if request("proname")<>"" then
dim proname
proname = request("proname")
ssql = ssql&"and D_title like '%"&proname&"%' "
end if
if request("pronum")<>"" then
dim pronum
pronum = request("pronum")
ssql = ssql&"and number like '%"&pronum&"%' "
end if
ssql = ssql&"order by date"
'response.Write(ssql)
ors.open ssql,oconn,3,3
ors.PageSize=9 ' PageSize 属性:显示 Recordset 对象每一页显示的记录数
dim page
Page=Cint(Request.QueryString("Page")) '转换成短整形Integer
if Page<1 then Page=1 '不足1页时,设定为1页
'PageCount 属性:显示 Recordset 对象包括多少“页”的数据
if Page>ors.PageCount Then Page=ors.PageCount 'Page比总页数还大时,设定为最后1页,即总页数。
if Page<>1 then '即大于第1页,小于最后1页
end if
If Not oRs.Eof Then
ors.AbsolutePage = Page 'AbsolutePage属性:设定当前记录的位置是位于哪一页?
dim i
for i=1 to ors.PageSize
%>
<table width="190" height="322" border="0" cellpadding="0" cellspacing="0" style="float:left;">
<tr>
<td width="194" height="30" align="left" class="hongen"><%=left(ors("D_title"),13)%>...</td>
</tr>
<tr>
<td height="182" align="center" valign="middle" bgcolor="#FFFDF9"><a href="productshow.asp?id=<%=ors("D_id")%>" target="_blank"><img src="<%=ors("D_Picture")%>" alt="" width="160" height="160" border="0" onload="javascript:if(this.height>this.width){this.height=160}else{this.width=160};" /></a></td>
</tr>
<tr>
<td class="huiziti" align="left"><table width="165" height="11" border="0" align="center" cellpadding="0" cellspacing="0" class="gao2">
<tr>
<td> </td>
</tr>
</table>
<table width="175" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><a href="productshow.asp?id=<%=ors("D_id")%>" target="_blank" class="new"><%=left(ors("number"),80)%>...</a></td>
</tr>
</table>
</td>
</tr>
</table>
<%
ors.Movenext
if ors.eof then exit For
next
Else
Response.Write "现在数据库中还没有数据!"
End If
%>
给你改了一下,估计是你外表格的宽度太小了
<link href="css/body.css" rel="stylesheet" type="text/css" />
<%
ssql = "select * from product where 1=1 "
if request("classid")<>"" then
dim classs
classs = request("classid")
isnum(classs)
bigclass = request("bigclass")
isnum(bigclass)
if bigclass = classs then
ssql = ssql&"and class in (select id from ppclass where followid="&bigclass&") "
if oconn.execute("select count(id) from ppclass where followid="&bigclass)(0) = 0 then
ssql = ssql & " or class = "&bigclass&" "
end if
else
ssql = ssql&"and class = "&classs&" "
end if
end if
if request("proname")<>"" then
dim proname
proname = request("proname")
ssql = ssql&"and D_title like '%"&proname&"%' "
end if
if request("pronum")<>"" then
dim pronum
pronum = request("pronum")
ssql = ssql&"and number like '%"&pronum&"%' "
end if
ssql = ssql&"order by date"
'response.Write(ssql)
ors.open ssql,oconn,3,3
ors.PageSize=9 ' PageSize 属性:显示 Recordset 对象每一页显示的记录数
dim page
Page=Cint(Request.QueryString("Page")) '转换成短整形Integer
if Page<1 then Page=1 '不足1页时,设定为1页
'PageCount 属性:显示 Recordset 对象包括多少“页”的数据
if Page>ors.PageCount Then Page=ors.PageCount 'Page比总页数还大时,设定为最后1页,即总页数。
if Page<>1 then '即大于第1页,小于最后1页
end if
If Not oRs.Eof Then
ors.AbsolutePage = Page 'AbsolutePage属性:设定当前记录的位置是位于哪一页?
dim i
for i=1 to ors.PageSize
%>
<table width="190" height="322" border="0" cellpadding="0" cellspacing="0" style="float:left;">
<tr>
<td width="194" height="30" align="left" class="hongen"><%=left(ors("D_title"),13)%>...</td>
</tr>
<tr>
<td height="182" align="center" valign="middle" bgcolor="#FFFDF9"><a href="productshow.asp?id=<%=ors("D_id")%>" target="_blank"><img src="<%=ors("D_Picture")%>" alt="" width="160" height="160" border="0" onload="javascript:if(this.height>this.width){this.height=160}else{this.width=160};" /></a></td>
</tr>
<tr>
<td class="huiziti" align="left"><table width="165" height="11" border="0" align="center" cellpadding="0" cellspacing="0" class="gao2">
<tr>
<td> </td>
</tr>
</table>
<table width="175" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><a href="productshow.asp?id=<%=ors("D_id")%>" target="_blank" class="new"><%=left(ors("number"),80)%>...</a></td>
</tr>
</table>
</td>
</tr>
</table>
<%
ors.Movenext
if ors.eof then exit For
next
Else
Response.Write "现在数据库中还没有数据!"
End If
%>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询