ASP调取图片时,怎么样让它横排显示?
以下是良精2007版的产品展示程序,但是这个是竖着的,能不能改成3排,每排4个,计12个产品.谢谢,程序如下:'=============================...
以下是良精2007版的产品展示程序,但是这个是竖着的,能不能改成3排,每排4个,计12个产品.谢谢,程序如下:
'=================================================
'过程名:ShowProduct
'=================================================
sub ShowProduct(TitleLen)
if TitleLen<0 or TitleLen>200 then
TitleLen=50
end if
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
sqlProduct="select top " & MaxPerPage
else
sqlProduct="select "
end if
sqlProduct=sqlProduct & " ID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,Price,Spec,Unit,Memo,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "
if BigClassName<>"" then
sqlProduct=sqlProduct & " and BigClassName='" & BigClassName & "' "
if SmallClassName<>"" then
sqlProduct=sqlProduct & " and SmallClassName='" & SmallClassName & "' "
end if
end if
sqlProduct=sqlProduct & " order by UpdateTime desc"
Set rsProduct= Server.CreateObject("ADODB.Recordset")
rsProduct.open sqlProduct,conn,1,1
if rsProduct.bof and rsProduct.eof then
response.Write("<br><li>没有任何产品</li>")
else
if currentPage=1 then
call ProductContent(TitleLen)
else
if (currentPage-1)*MaxPerPage<totalPut then
rsProduct.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rsProduct.bookmark
call ProductContent(TitleLen)
else
currentPage=1
call ProductContent(TitleLen)
end if
end if
end if
rsProduct.close
set rsProduct=nothing
end sub
sub ProductContent(intTitleLen)
dim i,strTemp
i=0
do while not rsProduct.eof
strTemp=""
strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td width=25% rowspan=6>"
strTemp= strTemp & "<div align=center><a href=ProductShow.asp?ID=" & rsProduct("ID") & ">"
fileExt=lcase(getFileExtName(rsProduct("DefaultPicUrl")))
if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then 展开
'=================================================
'过程名:ShowProduct
'=================================================
sub ShowProduct(TitleLen)
if TitleLen<0 or TitleLen>200 then
TitleLen=50
end if
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
sqlProduct="select top " & MaxPerPage
else
sqlProduct="select "
end if
sqlProduct=sqlProduct & " ID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,Price,Spec,Unit,Memo,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "
if BigClassName<>"" then
sqlProduct=sqlProduct & " and BigClassName='" & BigClassName & "' "
if SmallClassName<>"" then
sqlProduct=sqlProduct & " and SmallClassName='" & SmallClassName & "' "
end if
end if
sqlProduct=sqlProduct & " order by UpdateTime desc"
Set rsProduct= Server.CreateObject("ADODB.Recordset")
rsProduct.open sqlProduct,conn,1,1
if rsProduct.bof and rsProduct.eof then
response.Write("<br><li>没有任何产品</li>")
else
if currentPage=1 then
call ProductContent(TitleLen)
else
if (currentPage-1)*MaxPerPage<totalPut then
rsProduct.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rsProduct.bookmark
call ProductContent(TitleLen)
else
currentPage=1
call ProductContent(TitleLen)
end if
end if
end if
rsProduct.close
set rsProduct=nothing
end sub
sub ProductContent(intTitleLen)
dim i,strTemp
i=0
do while not rsProduct.eof
strTemp=""
strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td width=25% rowspan=6>"
strTemp= strTemp & "<div align=center><a href=ProductShow.asp?ID=" & rsProduct("ID") & ">"
fileExt=lcase(getFileExtName(rsProduct("DefaultPicUrl")))
if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then 展开
2个回答
展开全部
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<%
a=1
do while not rs.eof and how <=rs.pagesize
%>
<td><table height="132" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" bgcolor="F2F2F2"><br>
<table width="142" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="142"><div align="center"><a href="productxx.asp?id=<%=rs("id")%>"><img src="../<%=rs("pic")%>" width="117" height="88" border="0"></a></div></td>
</tr>
<tr>
<td height="29"><div align="center"><%=rs("xh")%></div></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table></td>
<%
if a mod 4=0 then
response.Write"<tr></tr>"
end if
rs.movenext
how=how+1
a=a+1
loop
%>
</tr>
</table>
或
<%
sql="select top 9 * from gg order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<%
a=1
do while not rs.eof
%>
<%
if a mod 3=0 then
response.write"<tr></tr>"
end if
rs.movenext
a=a+1
loop
%>
<tr>
<%
a=1
do while not rs.eof and how <=rs.pagesize
%>
<td><table height="132" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" bgcolor="F2F2F2"><br>
<table width="142" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="142"><div align="center"><a href="productxx.asp?id=<%=rs("id")%>"><img src="../<%=rs("pic")%>" width="117" height="88" border="0"></a></div></td>
</tr>
<tr>
<td height="29"><div align="center"><%=rs("xh")%></div></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table></td>
<%
if a mod 4=0 then
response.Write"<tr></tr>"
end if
rs.movenext
how=how+1
a=a+1
loop
%>
</tr>
</table>
或
<%
sql="select top 9 * from gg order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<%
a=1
do while not rs.eof
%>
<%
if a mod 3=0 then
response.write"<tr></tr>"
end if
rs.movenext
a=a+1
loop
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询