select top 4 * from products 现在只显示1行 我想让他每行显示3个,多出来后就另起一行显示
rsp.open"selecttop3*fromproductswhereanclassid="&rsd("anclassid")&"orderbyadddatedesc...
rsp.open"select top 3 * from products where anclassid="&rsd("anclassid")&" order by adddate desc",conn,1,1
if rsp.recordcount=0 then
怎么可以修改为每行显示4个,多出来的产品图片另起一行显示,这样循环下去?
yzzy11 | 五级
把下面循环显示内容的代码贴出来
好的,你看下
rsp.open"select top 3 * from products where anclassid="&rsd("anclassid")&" order by adddate desc",conn,1,1
if rsp.recordcount=0 then
response.write"<td>暂无该类产品</td>"
else
do while not rsp.eof
%>
<td width="140" align="left" valign="bottom"><a href="products.asp?id=<%=rsp("bookid")%>"><img src="<%=rsp("bookpic")%>" alt="<%=rsp("bookname")%>" width="140" border=0 style="border:1px solid #CCCCCC; padding:2px;" title="<%=rsp("bookname")%>"></a>
<div style="clear:both" align="center">
型号: <%=rsp("bookname")%></div>
</td>
<%rsp.movenext
loop
end if
rsp.close
set rsp=nothing
%></tr>
</table>
</td>
</tr><%
rsd.movenext
loop
end if
rsd.close
set rsd=nothing
%> 展开
if rsp.recordcount=0 then
怎么可以修改为每行显示4个,多出来的产品图片另起一行显示,这样循环下去?
yzzy11 | 五级
把下面循环显示内容的代码贴出来
好的,你看下
rsp.open"select top 3 * from products where anclassid="&rsd("anclassid")&" order by adddate desc",conn,1,1
if rsp.recordcount=0 then
response.write"<td>暂无该类产品</td>"
else
do while not rsp.eof
%>
<td width="140" align="left" valign="bottom"><a href="products.asp?id=<%=rsp("bookid")%>"><img src="<%=rsp("bookpic")%>" alt="<%=rsp("bookname")%>" width="140" border=0 style="border:1px solid #CCCCCC; padding:2px;" title="<%=rsp("bookname")%>"></a>
<div style="clear:both" align="center">
型号: <%=rsp("bookname")%></div>
</td>
<%rsp.movenext
loop
end if
rsp.close
set rsp=nothing
%></tr>
</table>
</td>
</tr><%
rsd.movenext
loop
end if
rsd.close
set rsd=nothing
%> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询