关于ASP表格循环嵌套的问题
<tablewidth="98%"><tr><tdheight="19"colspan="2"></td></tr><tr><%i=0dowhilenotrs.eof%>...
<table width="98%">
<tr>
<td height="19" colspan="2"></td>
</tr>
<tr>
<%i=0
do while not rs.eof%>
<td width="52%" height="68">
<table width="98%" style="BORDER-RIGHT:#C0C0C0 1px dashed; BORDER-TOP: #C0C0C0 1px dashed; BORDER-LEFT: #C0C0C0 1px dashed; BORDER-BOTTOM: #C0C0C0 1px dashed">
<tr>
<td width="33%" > <img src="<%=rs("img")%>" width="216" height="161" /></td>
<td width="67%" align="center" valign="top"><table width="100%">
<tr style="background-image:url('images/td.jpg');" onmouseover="this.style.backgroundImage='url(images/555.gif)'" onmouseout="this.style.backgroundImage='url(images/td.jpg)'">
<td align="center"><font size="+2" face="黑体"><%=rs("title") %></font></td>
</tr>
<tr>
<td><%=rs("neirong") %></td>
</tr>
</table></td>
</tr>
</table></td>
<%rs.movenext
i=i+1
if i=2 then exit do
loop
%>
<td width="48%"> </td>
</tr>
<tr>
<td height="68"></td>
<td></td>
</tr>
<tr>
<td height="68"></td>
<td></td>
</tr>
<tr>
<td height="68"></td>
<td></td>
</tr>
<tr>
<td height="68"></td>
<td></td>
</tr>
</table>
哪位大侠帮我改一下程序让两列循环下去 展开
<tr>
<td height="19" colspan="2"></td>
</tr>
<tr>
<%i=0
do while not rs.eof%>
<td width="52%" height="68">
<table width="98%" style="BORDER-RIGHT:#C0C0C0 1px dashed; BORDER-TOP: #C0C0C0 1px dashed; BORDER-LEFT: #C0C0C0 1px dashed; BORDER-BOTTOM: #C0C0C0 1px dashed">
<tr>
<td width="33%" > <img src="<%=rs("img")%>" width="216" height="161" /></td>
<td width="67%" align="center" valign="top"><table width="100%">
<tr style="background-image:url('images/td.jpg');" onmouseover="this.style.backgroundImage='url(images/555.gif)'" onmouseout="this.style.backgroundImage='url(images/td.jpg)'">
<td align="center"><font size="+2" face="黑体"><%=rs("title") %></font></td>
</tr>
<tr>
<td><%=rs("neirong") %></td>
</tr>
</table></td>
</tr>
</table></td>
<%rs.movenext
i=i+1
if i=2 then exit do
loop
%>
<td width="48%"> </td>
</tr>
<tr>
<td height="68"></td>
<td></td>
</tr>
<tr>
<td height="68"></td>
<td></td>
</tr>
<tr>
<td height="68"></td>
<td></td>
</tr>
<tr>
<td height="68"></td>
<td></td>
</tr>
</table>
哪位大侠帮我改一下程序让两列循环下去 展开
2个回答
展开全部
<table width="98%">
<tr>
<td height="19" colspan="2"></td>
</tr>
<%
Dim i=0
do while not rs.eof
i= i+1
%>
<% If i=0 then%>
<tr>
<% End If %>
<td width="50%" height="68">
<table width="98%" style="BORDER-RIGHT:#C0C0C0 1px dashed; BORDER-TOP: #C0C0C0 1px dashed; BORDER-LEFT: #C0C0C0 1px dashed; BORDER-BOTTOM: #C0C0C0 1px dashed">
<tr>
<td width="33%" > <img src="<%=rs("img")%>" width="216" height="161" /></td>
<td width="67%" align="center" valign="top"><table width="100%">
<tr style="background-image:url('images/td.jpg');" onmouseover="this.style.backgroundImage='url(images/555.gif)'" onmouseout="this.style.backgroundImage='url(images/td.jpg)'">
<td align="center"><font size="+2" face="黑体"><%=rs("title") %></font></td>
</tr>
<tr>
<td><%=rs("neirong") %></td>
</tr>
</table></td>
</tr>
</table></td>
<% If i=2 then%>
</tr>
<% End If %>
<%
rs.movenext
loop
%>
<tr>
<td height="68"></td>
<td></td>
</tr>
</table>
<tr>
<td height="19" colspan="2"></td>
</tr>
<%
Dim i=0
do while not rs.eof
i= i+1
%>
<% If i=0 then%>
<tr>
<% End If %>
<td width="50%" height="68">
<table width="98%" style="BORDER-RIGHT:#C0C0C0 1px dashed; BORDER-TOP: #C0C0C0 1px dashed; BORDER-LEFT: #C0C0C0 1px dashed; BORDER-BOTTOM: #C0C0C0 1px dashed">
<tr>
<td width="33%" > <img src="<%=rs("img")%>" width="216" height="161" /></td>
<td width="67%" align="center" valign="top"><table width="100%">
<tr style="background-image:url('images/td.jpg');" onmouseover="this.style.backgroundImage='url(images/555.gif)'" onmouseout="this.style.backgroundImage='url(images/td.jpg)'">
<td align="center"><font size="+2" face="黑体"><%=rs("title") %></font></td>
</tr>
<tr>
<td><%=rs("neirong") %></td>
</tr>
</table></td>
</tr>
</table></td>
<% If i=2 then%>
</tr>
<% End If %>
<%
rs.movenext
loop
%>
<tr>
<td height="68"></td>
<td></td>
</tr>
</table>
展开全部
<table width="98%">你测试一下
<tr>
<td height="19" colspan="2"></td>
</tr>
<%
i=0
do while not rs.eof
if i mod 2=0 then
%>
<tr>
<td width="52%" height="68">
<%
else
%>
<td width="48%">
<%
end if
%>
<table width="98%" style="BORDER-RIGHT:#C0C0C0 1px dashed; BORDER-TOP: #C0C0C0 1px dashed; BORDER-LEFT: #C0C0C0 1px dashed; BORDER-BOTTOM: #C0C0C0 1px dashed">
<tr>
<td width="33%" > <img src="<%=rs("img")%>" width="216" height="161" /></td>
<td width="67%" align="center" valign="top">
<table width="100%">
<tr style="background-image:url('images/td.jpg');" onmouseover="this.style.backgroundImage='url(images/555.gif)'" onmouseout="this.style.backgroundImage='url(images/td.jpg)'">
<td align="center"><font size="+2" face="黑体"><%=rs("title") %></font></td>
</tr>
<tr>
<td><%=rs("neirong") %></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<%
rs.movenext
i=i+1
if i mod 2=0 then
%>
</tr>
<%
end if
loop
%>
</table>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询