一个搜索页,将搜索结果按照3行4列的方式排列,总是出问题,那位帮我看看, 下面是代码是1行1列的方式,帮我改下,谢谢!
<BODY>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" id="AutoNumber3" style="border-collapse: collapse">
<tr>
<td height="30"> <img src="images/result.jpg" width="336" height="30">Key:<%=keyword%></b></td>
</tr>
<tr>
<td align="center"><%set rs=server.CreateObject("ADODB.RecordSet")
key_word="select * from product where " & findword & " order by UpdateTime DESC"
rs.Open key_word,conn,1,1
rs.PageSize=20
rs.CacheSize = RS.PageSize
for i=1 to rs.PageSize *( page-1)
if not rs.EOF then
rs.MoveNext
end if
next
if rs.EOF then
Response.Write "<font color=red>SORRY!Can't find.</font>"
else
rs.PageSize = MyPageSize
MaxPages = rs.PageCount
rs.absolutepage = MyPage
total = rs.RecordCount
end if
If Not rs.eof then
i = 0
do until rs.Eof or i = rs.PageSize
%>
<table width="135" height="119" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="109" colspan="2" align="center" valign="middle" background="images/prodbg.jpg"><a href="productdetail.asp?productid=<%=rs("productid")%>" target="_blank"><img border="0" src="<%=replace(rs("defaultpic"),"../../","")%>" width="113" height="85"></a></td>
</tr>
<tr>
<td width="135" height="10" align="center" valign="middle" class="style1"><a href="productdetail.asp?productid=<%=rs("productid")%>"><%=rs(filed)%> </a></td>
<td width="14" valign="middle"><img src="images/dot1.gif" width="11" height="9" /></td>
</tr>
</table>
<%
rs.MoveNext
i = i + 1
loop
%></td></tr>
<tr>
<td width="100%" height=30 align=center>Total:<font color="#0033FF"><%=total%></font>, It's <font color="#0033FF"><%=Mypage%>/<%=Maxpages%></font> Page,
<%
url="Result.asp?action="&request("action")&"&keyword=" & keyword
PageNextSize=int((MyPage-1)/PageShowSize)+1
Pagetpage=int((total-1)/rs.PageSize)+1
if PageNextSize >1 then
PagePrev=PageShowSize*(PageNextSize-1)
Response.write "<a class=black href='" & Url & "&page=" & PagePrev & "' >Previous</a> "
Response.write "<a class=black href='" & Url & "&page=1'>Home</a> "
end if
if MyPage-1 > 0 then
Prev_Page = MyPage - 1
Response.write "<a class=black href='" & Url & "&page=" & Prev_Page & "'>Previous</a> "
end if
if Maxpages>=PageNextSize*PageShowSize then
PageSizeShow = PageShowSize
Else
PageSizeShow = Maxpages-PageShowSize*(PageNextSize-1)
End if
If PageSizeShow < 1 Then PageSizeShow = 1
for PageCounterSize=1 to PageSizeShow
PageLink = (PageCounterSize+PageNextSize*PageShowSize)-PageShowSize
if PageLink <> MyPage Then
Response.write "<a class=black href='" & Url & "&page=" & PageLink & "'>[" & PageLink & "]</a> "
else
Response.Write "<B>["& PageLink &"]</B> "
end if
If PageLink = MaxPages Then Exit for
Next
if Mypage+1 <=Pagetpage then
Next_Page = MyPage + 1
Response.write "<a class=black href='" & Url & "&page=" & Next_Page & "'>Next</A>"
end if
if MaxPages > PageShowSize*PageNextSize then
PageNext = PageShowSize * PageNextSize + 1
Response.write " <A class=black href='" & Url & "&page=" & Pagetpage & "'>End</A>"
Response.write " <a class=black href='" & Url & "&page=" & PageNext & "'>Next</a>"
End if
end if
rs.close
%>
</td>
</tr>
</table>