(asp急!!)Do While Not rs.EOF循环以N行3列显示该怎么解决?
我现在的代码是这样的:<%rs.pagesize=12rs.AbsolutePage=page_nodimII=12dowhilenotrs.eofandI>0I=I-3...
我现在的代码是这样的:
<%
rs.pagesize=12
rs.AbsolutePage=page_no
dim I
I=12
do while not rs.eof and I>0
I=I-3
%>
<table width="100" height="68" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="75"><table width="100" border="0" cellpadding="0" cellspacing="5" class="bkys">
<tr>
<td><a href="cptpmore.asp?id=<%=rs("id")%>" target="_blank"><img src="admin/admin/<%=rs("tupian")%>" width="150" height="148" border="0"></a></td>
</tr>
</table></td>
<td width="25" valign="bottom"><img src="main_img/yjxdb/port_right.gif" width="17" height="135"></td>
</tr>
<tr>
<td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="3">
<tr>
<td height="15">名称: <%=rs("cpname")%> </td>
</tr>
<tr>
<td height="15">型号: <%=rs("bianhao")%></td>
</tr>
</table></td>
<td valign="bottom"> </td>
</tr>
</table>
<%
rs.movenext
loop
end if
%>
我现在想让他每行并排显示三列然后在自动换行?好久没做想不起改怎么做?
请各位高手指点一下~谢谢~!!
问题补充:我只想问一下
dim I
I=12
do while not rs.eof and I>0
I=I-3
%>
该怎么写啊~在原来的基础上做!
我只想问一下
dim I
I=12
do while not rs.eof and I>0
I=I-3
%>
该怎么写啊~在原来的基础上做! 展开
<%
rs.pagesize=12
rs.AbsolutePage=page_no
dim I
I=12
do while not rs.eof and I>0
I=I-3
%>
<table width="100" height="68" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="75"><table width="100" border="0" cellpadding="0" cellspacing="5" class="bkys">
<tr>
<td><a href="cptpmore.asp?id=<%=rs("id")%>" target="_blank"><img src="admin/admin/<%=rs("tupian")%>" width="150" height="148" border="0"></a></td>
</tr>
</table></td>
<td width="25" valign="bottom"><img src="main_img/yjxdb/port_right.gif" width="17" height="135"></td>
</tr>
<tr>
<td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="3">
<tr>
<td height="15">名称: <%=rs("cpname")%> </td>
</tr>
<tr>
<td height="15">型号: <%=rs("bianhao")%></td>
</tr>
</table></td>
<td valign="bottom"> </td>
</tr>
</table>
<%
rs.movenext
loop
end if
%>
我现在想让他每行并排显示三列然后在自动换行?好久没做想不起改怎么做?
请各位高手指点一下~谢谢~!!
问题补充:我只想问一下
dim I
I=12
do while not rs.eof and I>0
I=I-3
%>
该怎么写啊~在原来的基础上做!
我只想问一下
dim I
I=12
do while not rs.eof and I>0
I=I-3
%>
该怎么写啊~在原来的基础上做! 展开
1个回答
展开全部
<table>
<tr>
<%
rs.pagesize=12
rs.AbsolutePage=page_no
dim I
I=0
do while not rs.eof and I>0
%>
<td>
<table width="100" height="68" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="75"><table width="100" border="0" cellpadding="0" cellspacing="5" class="bkys">
<tr>
<td><a href="cptpmore.asp?id=<%=rs("id")%>" target="_blank"><img src="admin/admin/<%=rs("tupian")%>" width="150" height="148" border="0"></a></td>
</tr>
</table></td>
<td width="25" valign="bottom"><img src="main_img/yjxdb/port_right.gif" width="17" height="135"></td>
</tr>
<tr>
<td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="3">
<tr>
<td height="15">名称: <%=rs("cpname")%> </td>
</tr>
<tr>
<td height="15">型号: <%=rs("bianhao")%></td>
</tr>
</table></td>
<td valign="bottom"> </td>
</tr>
</table>
</td>
<%
rs.movenext
i=i+1
if (i mod 3)=0 then
response.Write("</tr>")
end if
loop
end if
%>
</table>
<tr>
<%
rs.pagesize=12
rs.AbsolutePage=page_no
dim I
I=0
do while not rs.eof and I>0
%>
<td>
<table width="100" height="68" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="75"><table width="100" border="0" cellpadding="0" cellspacing="5" class="bkys">
<tr>
<td><a href="cptpmore.asp?id=<%=rs("id")%>" target="_blank"><img src="admin/admin/<%=rs("tupian")%>" width="150" height="148" border="0"></a></td>
</tr>
</table></td>
<td width="25" valign="bottom"><img src="main_img/yjxdb/port_right.gif" width="17" height="135"></td>
</tr>
<tr>
<td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="3">
<tr>
<td height="15">名称: <%=rs("cpname")%> </td>
</tr>
<tr>
<td height="15">型号: <%=rs("bianhao")%></td>
</tr>
</table></td>
<td valign="bottom"> </td>
</tr>
</table>
</td>
<%
rs.movenext
i=i+1
if (i mod 3)=0 then
response.Write("</tr>")
end if
loop
end if
%>
</table>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询