现在的效果:
|图片|
|图片|
|图片|
|图片|
|图片|
|图片|
|图片|
|图片|
|图片|
我想要的效果
|图片||图片||图片|
|图片||图片||图片|
|图片||图片||图片|
我现在的代码如下:
<%
if catid="" then
response.Redirect "procat.asp"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select category from category where categoryid="&catid&" ",conn,1,1
strcat = trim(rs("category"))
rs.close
set rs = nothing
%>
<TABLE WIDTH="760" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0" class=table-zuoyou>
<tr><td width="180" valign=top>
<table class=table-you>
<tr>
<td class=table-xia> </td>
</tr>
<% if zuo1<>"" then %>
<tr>
<td align="center" class=table-xia><A HREF=<%=zuo1url%> TARGET="_blank"></A></td>
</tr>
<% end if %>
<tr>
<td class=table-xia> </td>
</tr>
<% if zuo2<>"" then %>
<tr>
<td align="center" class=table-xia><A HREF=<%=zuo2url%> TARGET="_blank"></A></td>
</tr>
<% end if %>
<tr>
<td class=table-xia> </td>
</tr>
<% if zuo3<>"" then %>
<tr>
<td align="center" class=table-xia><A HREF=<%=zuo3url%> TARGET="_blank"></A></td>
</tr>
<% end if %>
<tr>
<td class=table-xia> </td>
</tr>
<% if zuo4<>"" then %>
<tr>
<td align="center" class=table-xia><A HREF=<%=zuo4url%> TARGET="_blank"></A></td>
</tr>
<% end if %>
<tr>
<td class=table-xia> </td>
</tr>
<tr>
<td class=table-xia> </td>
</tr>
</table>
</td><td width="580" valign="top" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top">
<%
Const MaxPerPage=3
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(SafeRequest("page",1)) then
currentPage=Cint(SafeRequest("page",1))
else
currentPage=1
end if
set rs=server.CreateObject("adodb.recordset")
if catid="" then
rs.open "select top 20 prename,company,mark,pretype,intro,other,type,viewnum,grade,predate,id,name,introduce,price1,price2,discount,productdate,pic from product order by adddate desc",conn,1,1
else
rs.open "select predate,prename,company,mark,pretype,intro,name,other,type,viewnum,grade,id,introduce,price1,price2,discount,productdate,pic from product where categoryid="&catid&" order by adddate desc",conn,1,1
end if
if err.number<>0 then
response.write "数据库中暂时无数据"
end if
if rs.eof And rs.bof then
Response.Write "<p align='center' class='contents'> 对不起,此分类暂时还没有商品!</p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"cat.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"cat.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"cat.asp"
end if
end if
end if
sub showContent
dim i
i=0
%>
<%
do while not rs.eof%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="3" class=table-xia>
<tr>
<td width="20%" valign="middle" align="center">
<TABLE WIDTH="100" HEIGHT="100" BORDER="0" CELLPADDING="0" CELLSPACING="1" BGCOLOR="#cccccc">
<TR>
<TD align="center" valign="middle" bgcolor="#FFFFFF">
<a href=product.asp?id=<% = rs("id") %>>
<% if trim(rs("pic"))<>"" then %>
<img src=<% = trim(rs("pic"))%> border=0 width="<% = webimg9 %>" height="<% = webimg10 %>"></a>
<% else %>
<img src=images/emptybook.jpg border=0 width="<% = webimg9 %>" height="<% = webimg10 %>"></a>
<% end if %>
</TD></TR>
</TABLE>
</td>
<td width="80%"> <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
<tr>
<td colspan="3"><a href=product.asp?id=<%=rs("id")%>></a></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td width="37%"> </td>
<td width="63%" colspan="2"> </td>
</tr>
<tr><td height="10"></td></tr>
</table>
</td>
</tr>
</table>
<%
i=i+1
if i>=MaxPerPage then Exit Do
rs.movenext
loop
rs.close
set rs=nothing
%>
<%
End Sub
Function showpage(totalnumber,maxperpage,filename)
Dim n
If totalnumber Mod maxperpage=0 Then
n= totalnumber \ maxperpage
Else
n= totalnumber \ maxperpage+1
End If %>
请高手指点修改啊,我快要急死掉了,,,,,,,,,,..