下面是图片显示是否换到下一表格行输出和补齐单元格的代码,实才不懂,请行家指教。
代码实才之长,我把与有关用红色标示<!--#include file="conn.asp" -->
<!--#include file="yz_mgr/inc/function.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>飞雪网上购物系统</title>
<link href="inc/main.css" rel="stylesheet" type="text/css">
</head>
<% shopid=Request("shopid") %>
<body leftmargin="0" topmargin="0">
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><!--#include file="top.asp" --></td>
</tr>
<tr>
<td height=40 class="text1"> 当前分类:
<%
Set Rs = Server.CreateObject("ADODB.RecordSet")
Sql = "Select * From [Shop_Class] Where ID="&shopid
Rs.Open Sql,Conn,1,1
If Not Rs.Eof And Not Rs.Bof Then
Response.Write Rs("Name")
End If
Rs.Close
Set Rs=nothing
%>
</td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<% Dim i
Set Rs = Server.CreateObject("ADODB.RecordSet")
Sql = "Select * From [Shop_Goods] Where ShopID="&shopid
Rs.Open Sql,Conn,1,1
If Rs.Eof And Rs.Bof Then
Response.Write "<tr><td height=60 colspan=5 align=center>没有对应商品!</td></tr>"
Else
Page = Request("Page")
If Page="" Then Page=1
Rs.PageSize = 15
PageSize = Rs.PageSize
Rs.AbsolutePage = Page
i = 0
Do While Not Rs.Eof And PageSize>0
%>
<td width="20%" align="center" valign="top"><table width="160" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="info.asp?shopid=<%=Rs("ShopID")%>&id=<%=Rs("ID")%>" target="_blank"><img src="uppic/<%=Rs("Pic")%>" width="160" height="150" class="imgborder" border="0"></a></td>
</tr>
<tr>
<td align="center"><a href="info.asp?shopid=<%=Rs("ShopID")%>&id=<%=Rs("ID")%>" target="_blank"><%=Rs("Name")%></a></td>
</tr>
<tr>
<td align="center">价格:¥<%=Rs("SalePrice")%></td>
</tr>
<tr>
<td align="center"><a href="buy_car.asp?id=<%=Rs("ID")%>"><img src="images/btn_buy.gif" border=0></a> <a href="info.asp?shopid=<%=Rs("ShopID")%>&id=<%=Rs("ID")%>" target="_blank"><img src="images/btn_detail.gif" border=0></a></td>
</tr>
</table></td>
<% i = i + 1
If i mod 5 = 0 Then Response.Write "</tr><tr><td height=15 colspan=5></td></tr></tr>"
PageSize = PageSize-1
Rs.MoveNext
Loop
If Rs.RecordCount mod 5 > 0 Then
For k = 1 to 5 - (Rs.RecordCount mod 5)
Response.Write "<td align=center width='20%'> </td>"
Next
End If
%>
</tr>
<tr>
<td height="15" colspan="5"></td>
</tr>
<tr>
<td colspan="5" align="right">
<%
Response.Write "每页" &Rs.PageSize& "条/共" &Rs.RecordCount& "条 第" &Page& "页/共" &Rs.PageCount& "页 "
Response.Write "<a href=?shopid="&shopid&"&Page=1>首 页</a> "
If CInt(Page)>1 then
Response.Write "<a href=?shopid="&shopid&"&Page="&Page-1&">上一页</a> "
Else
Response.Write "上一页 "
End If
If CInt(Page)<Rs.PageCount then
Response.Write "<a href=?shopid="&shopid&"&Page="&Page+1&">下一页</a> "
Else
Response.Write "下一页 "
End If
Response.Write "<a href=?shopid="&shopid&"&Page="&Rs.PageCount&">末 页</a> "
%>
</td>
</tr>
<% End If
Rs.Close
Set Rs=nothing
%>
</table></td>
</tr>
<tr>
<td><!--#include file="bottom.asp" --></td>
</tr>
</table>
</body>
</html>