ASP调用产品图片排列方式(由横排改为竖排)
<tablewidth="100%"border="0"cellspacing="0"cellpadding="0"><tr><%BigclassP=trim(reque...
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<%BigclassP=trim(request("classP"))
SmallClassP=trim(request("SmallClassP"))
keyword=request.form("keyword")
filename="product.asp?"
sql="select * From [product]"
If BigclassP<>"" then
sql=sql&" where BigclassP='"&BigClassP&"'"
filename=filename&"classP="&BigClassP
ElseIf keyword<>"" then
sql=sql&" where name like '%"&keyword&"%'"
filename=filename&"keyword="&keyword
ElseIf SmallClassP<>"" then
sql="where SmallClassP='"&SmallClassP&"'"
filename=filename&"SmallClassP="&SmallClassP
End If
sql=sql&" order by Product_ID desc"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof or rs.bof then
response.Write "<p>没有相关记录</p>"
else
MaxPerPage=20
dim allcount
totalnumber=rs.recordcount
dim page
if not request("page")="" then
Page=cint(request("page"))
else
Page=1
end if
i=0
j=0
rs.move (Page-1)*MaxPerPage
do while not rs.eof
i=i+1
If (J<>0 and J mod 5)=0 Then
Response.Write "</tr><tr>"
End If
j=j+1
%>
<td width="147" height="158"><table cellspacing="0" width="130" border="0">
<tbody>
<tr>
<td style="PADDING-RIGHT: 7px; PADDING-LEFT: 7px; PADDING-BOTTOM: 2px; PADDING-TOP: 7px" valign="center" align="middle" width="116" background="images/class_bg.gif" height="116"><A href='product_detail.asp?id=<%=rs("ID")%>'><img height="106" src="yxh/<%=rs("image")%>" width="116" border="0" /></A></td>
</tr>
<tr>
<td style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 4px" valign="top" align="middle" bgcolor="#f5f5f5"><table cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td valign="center" align="middle" height="22"><%=cutstr(rs("Name"),12)%></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
<%if i>=MaxPerPage then exit do
rs.movenext
loop
end if
call showpage(page,totalnumber,maxperpage,filename)
rs.close:set rs=nothing%>
</tr>
</table>
现在的效果为横排的 一排5个产品,一页可排4行,总共显示20个产品。。。我现在想改为竖排的··一页只显示8个图片,请高手们帮忙解决!先谢谢了!
参照效果··http://www.ifancy.cc/nokia.asp 展开
<tr>
<%BigclassP=trim(request("classP"))
SmallClassP=trim(request("SmallClassP"))
keyword=request.form("keyword")
filename="product.asp?"
sql="select * From [product]"
If BigclassP<>"" then
sql=sql&" where BigclassP='"&BigClassP&"'"
filename=filename&"classP="&BigClassP
ElseIf keyword<>"" then
sql=sql&" where name like '%"&keyword&"%'"
filename=filename&"keyword="&keyword
ElseIf SmallClassP<>"" then
sql="where SmallClassP='"&SmallClassP&"'"
filename=filename&"SmallClassP="&SmallClassP
End If
sql=sql&" order by Product_ID desc"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof or rs.bof then
response.Write "<p>没有相关记录</p>"
else
MaxPerPage=20
dim allcount
totalnumber=rs.recordcount
dim page
if not request("page")="" then
Page=cint(request("page"))
else
Page=1
end if
i=0
j=0
rs.move (Page-1)*MaxPerPage
do while not rs.eof
i=i+1
If (J<>0 and J mod 5)=0 Then
Response.Write "</tr><tr>"
End If
j=j+1
%>
<td width="147" height="158"><table cellspacing="0" width="130" border="0">
<tbody>
<tr>
<td style="PADDING-RIGHT: 7px; PADDING-LEFT: 7px; PADDING-BOTTOM: 2px; PADDING-TOP: 7px" valign="center" align="middle" width="116" background="images/class_bg.gif" height="116"><A href='product_detail.asp?id=<%=rs("ID")%>'><img height="106" src="yxh/<%=rs("image")%>" width="116" border="0" /></A></td>
</tr>
<tr>
<td style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 4px" valign="top" align="middle" bgcolor="#f5f5f5"><table cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td valign="center" align="middle" height="22"><%=cutstr(rs("Name"),12)%></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
<%if i>=MaxPerPage then exit do
rs.movenext
loop
end if
call showpage(page,totalnumber,maxperpage,filename)
rs.close:set rs=nothing%>
</tr>
</table>
现在的效果为横排的 一排5个产品,一页可排4行,总共显示20个产品。。。我现在想改为竖排的··一页只显示8个图片,请高手们帮忙解决!先谢谢了!
参照效果··http://www.ifancy.cc/nokia.asp 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询