新微赢技术网

标题: 图片排列问题:每行三张,每页三行,先谢谢了! [打印本页]

作者: 芯頽廢.。﹖    时间: 2010-1-15 02:34
标题: 图片排列问题:每行三张,每页三行,先谢谢了!
代码显示的结果是:
1
1
1
1
1
而我需要的结果是:每行三张图片,每页显示三行
1 1 1
1 1 1
1 1 1
下面是代码,请大家帮忙

<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td>
<%
else
rs.PageSize =10 '每页记录条数
iCount=rs.RecordCount '记录总数
iPageSize=rs.PageSize
maxpage=rs.PageCount
page=request("page")

if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if

if page<1 then
page=1
elseif page>maxpage then
page=maxpage
end if

rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if

For i=1 To x
%>
<table width="25%" border="0" cellpadding="5" cellspacing="0">
<tr>
<td><TABLE onmouseover="this.style.backgroundColor='#FF6600'" onmouseout="this.style.backgroundColor=''" width=120 cellSpacing=1 cellPadding=2 bgColor=#e1e1e1 border=0>
<TBODY>
<TR>
<TD width=100 bgColor=#ffffff align=center>
<%if rs("bookpic")="" then
response.write "<div align=center><a href=list.asp?id="&rs("bookid")&" ><img src=images/emptybook.gif width=90 height=90 border=0></a></div>"
else%>
<a href=list.asp?id=<%=rs("bookid")%> ><img src="<%=trim(rs("bookpic"))%>" width=120 border=0 height=120></a>
<%end if%>
</td>
</tr>
</tbody>
</table>
<table width="120" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align=center> 市场价:<s><%=trim(rs("shichangjia"))%>
元</s></td>
</tr>
</table></td>
</tr>
</table>
<%rs.movenext
next
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
end if
rs.close
set rs=nothing
Sub PageControl(iCount,pagecount,page,table_style,font_style)
'生成上一页下一页链接
Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next
Response.Write("<table width=100% border=0 cellpadding=0 cellspacing=0 >" & vbCrLf )
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR >" & vbCrLf )
Response.Write("<TD align=center height=35>" & vbCrLf )
Response.Write(font_style & vbCrLf )

if page<=1 then
Response.Write ("首 页 " & vbCrLf)
Response.Write ("上一页 " & vbCrLf)
else
Response.Write("<A href=" & action & "?" & temp & "Page=1>首 页</A> " & vbCrLf)
Response.Write("<A href=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</A> " & vbCrLf)
end if
if page>=pagecount then
Response.Write ("下一页 " & vbCrLf)
Response.Write ("尾 页 " & vbCrLf)
else
Response.Write("<A href=" & action & "?" & temp & "Page=" & (Page+1) & ">下一页</A> " & vbCrLf)
Response.Write("<A href=" & action & "?" & temp & "Page=" & pagecount & ">尾 页</A> " & vbCrLf)
end if
Response.Write(" 页次:" & page & "/" & pageCount & "页" & vbCrLf)
Response.Write(" 共有" & iCount & "种商品" & vbCrLf)
Response.Write(" 转到" & "<INPUT CLASS=wenbenkuang TYEP=TEXT NAME=page SIZE=2 Maxlength=5 VALUE=" & page & ">" & "页" & vbCrLf & "<INPUT CLASS=go-wenbenkuang type=submit value=GO>")
Response.Write("</TD>" & vbCrLf )
Response.Write("</TR></form>" & vbCrLf )
Response.Write("</table>" & vbCrLf )
End Sub
%>
</td>
</tr>
</table>
作者: ╰☆惢棂擱淺    时间: 2010-1-15 02:34
变量%3
作者: ...火狐狸```    时间: 2010-1-15 02:34
<table width="100%" border="0">
<tr>
<%
i=0
do while not rs.eof and i<10
%>
<TD>
<img src="<%=trim(rs("bookpic"))%>"
</TD>
<%
i=i+1
if i mod 3 = 0 then%>
</tr><tr>
<%
end if
rs.movenext
loop
%>
作者: 绝爱吗?    时间: 2010-1-15 02:34
前面刚刚有人问过,还在本页!
http://www.bc-cn.net/bbs/dispbbs.asp?boardID=10&ID=74535&page=1

<table width="12%" height="102" border="1" cellpadding="0" cellspacing="0">
<tr>
<%
i=0
do while not i>=20
%>

<td width=25%><center><%=i%></center></td>
<% i=i+1 %>
<%if i mod 4=0 then %>
</tr>
<% end if %>

<%
loop
%>
</table>

作者: n煲    时间: 2010-1-19 12:05
够震撼!够创新!!




欢迎光临 新微赢技术网 (http://bbs.weiying.cn/) Powered by Discuz! X3.2