![]() |
#2
yessanya2011-11-16 23:34
|

<%
set rs_cp=server.CreateObject("adodb.recordset")
sql="select * from products order by cp_sj desc"
rs_cp.open sql,conn,1,1
%>
<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="23"></td>
</tr>
</table>
<table width="760" height="769" border="0" cellpadding="0" cellspacing="0" class="class">
<tr>
<td height="767" align="center" valign="top">
<table width="200" height="324" border="0" cellpadding="0" cellspacing="0" class="tb_4_bian">
<%if not(rs_cp.bof or rs_cp.eof) then
rs_cp.pagesize=6 '每页显示记录条数
if request("page")<>"" then
epage=cint(request("page"))
if epage<1 then epage=1
if epage>rs_cp.pagecount then epage=rs_cp.pagecount
else
epage=1
end if
rs_cp.absolutepage=epage
for i=0 to rs_cp.pagesize-1
if rs_cp.bof or rs_cp.eof then exit for
%>
<tr>
<td width="200" height="200" align="center" valign="middle"><img src="upload/<%=rs_cp("cp_image")%>" alt="<%=rs_cp("cp_jianjie")%>" width="200" height="200" border="0" style="cursor:pointer;BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #cccccc 1px solid; PADDING-TOP: 8px; BORDER-BOTTOM: #cccccc 1px solid;" /></td>
</tr>
<tr>
<td width="200" height="20" align="center"></td>
</tr>
<tr>
<td width="200" height="34" class="xu_xian_botton">产品名称:<%=rs_cp("cp_mc")%></td>
</tr>
<tr>
<td height="35" class="xu_xian_botton">产品价格:<%=formatnumber(rs_cp("cp_dj"),-1,-1)%>元/<%=rs_cp("cp_dw")%></td>
</tr>
<tr class="pt_10_white">
<td width="200" height="35"><%call GetStringLength(rs_cp("cp_jianjie"),12)%></td>
</tr>
<%
rs_cp.movenext
next
%>
</table>
<table width="100%" height="12" border="0" cellpadding="0" cellspacing="0" class="pt10">
<tr>
<td></td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" class="pt10_hui">
<tr align="center" valign="bottom">
<td height="22">第<font color="FFFFFF"><%=epage%></font>页/共<font color="FFFFFF"><%=rs_cp.pagecount%></font>页 共<font color="FFFFFF"><%=rs_cp.recordcount%></font>条记录
<%if epage<>1 then%>
<a class="hui" href="?page=0">第一页</a>
<%else%>
第一页
<%end if%>
<%if epage<>1 then%>
<a class="hui" href="?page=<%=epage-1%>">上一页</a>
<%else%>
上一页
<%end if%>
<%if epage<>rs_cp.pagecount then%>
<a class="hui" href="?page=<%=epage+1%>">下一页</a>
<%else%>
下一页
<%end if%>
<%if epage<>rs_cp.pagecount then%>
<a class="hui" href="?page=<%=rs_cp.recordcount%>">最后页</a>
<%else%>
最后页
<%end if%>
跳转到第
<input type="text" name="go" id="go" style="width:20px;height:20px;text-align:center;vertical:middle">
页
<input type="button" name="skip" value="Go" onClick="window.location.href='?page='+document.getElementById('go').value">
</form>
<%end if%>
</td>
</tr>
</table>
<table width="100%" height="12" border="0" cellpadding="0" cellspacing="0" class="pt10">
<tr>
<td></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
如何修改代码让横纵显示成 3x2排列? set rs_cp=server.CreateObject("adodb.recordset")
sql="select * from products order by cp_sj desc"
rs_cp.open sql,conn,1,1
%>
<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="23"></td>
</tr>
</table>
<table width="760" height="769" border="0" cellpadding="0" cellspacing="0" class="class">
<tr>
<td height="767" align="center" valign="top">
<table width="200" height="324" border="0" cellpadding="0" cellspacing="0" class="tb_4_bian">
<%if not(rs_cp.bof or rs_cp.eof) then
rs_cp.pagesize=6 '每页显示记录条数
if request("page")<>"" then
epage=cint(request("page"))
if epage<1 then epage=1
if epage>rs_cp.pagecount then epage=rs_cp.pagecount
else
epage=1
end if
rs_cp.absolutepage=epage
for i=0 to rs_cp.pagesize-1
if rs_cp.bof or rs_cp.eof then exit for
%>
<tr>
<td width="200" height="200" align="center" valign="middle"><img src="upload/<%=rs_cp("cp_image")%>" alt="<%=rs_cp("cp_jianjie")%>" width="200" height="200" border="0" style="cursor:pointer;BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #cccccc 1px solid; PADDING-TOP: 8px; BORDER-BOTTOM: #cccccc 1px solid;" /></td>
</tr>
<tr>
<td width="200" height="20" align="center"></td>
</tr>
<tr>
<td width="200" height="34" class="xu_xian_botton">产品名称:<%=rs_cp("cp_mc")%></td>
</tr>
<tr>
<td height="35" class="xu_xian_botton">产品价格:<%=formatnumber(rs_cp("cp_dj"),-1,-1)%>元/<%=rs_cp("cp_dw")%></td>
</tr>
<tr class="pt_10_white">
<td width="200" height="35"><%call GetStringLength(rs_cp("cp_jianjie"),12)%></td>
</tr>
<%
rs_cp.movenext
next
%>
</table>
<table width="100%" height="12" border="0" cellpadding="0" cellspacing="0" class="pt10">
<tr>
<td></td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" class="pt10_hui">
<tr align="center" valign="bottom">
<td height="22">第<font color="FFFFFF"><%=epage%></font>页/共<font color="FFFFFF"><%=rs_cp.pagecount%></font>页 共<font color="FFFFFF"><%=rs_cp.recordcount%></font>条记录
<%if epage<>1 then%>
<a class="hui" href="?page=0">第一页</a>
<%else%>
第一页
<%end if%>
<%if epage<>1 then%>
<a class="hui" href="?page=<%=epage-1%>">上一页</a>
<%else%>
上一页
<%end if%>
<%if epage<>rs_cp.pagecount then%>
<a class="hui" href="?page=<%=epage+1%>">下一页</a>
<%else%>
下一页
<%end if%>
<%if epage<>rs_cp.pagecount then%>
<a class="hui" href="?page=<%=rs_cp.recordcount%>">最后页</a>
<%else%>
最后页
<%end if%>
跳转到第
<input type="text" name="go" id="go" style="width:20px;height:20px;text-align:center;vertical:middle">
页
<input type="button" name="skip" value="Go" onClick="window.location.href='?page='+document.getElementById('go').value">
</form>
<%end if%>
</td>
</tr>
</table>
<table width="100%" height="12" border="0" cellpadding="0" cellspacing="0" class="pt10">
<tr>
<td></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>