ASP网页中重复区域横向换行显示代码如何写

求救横向显示数量控制的代码。以下是用DV8 JavaScript制作的代码,现可以横向显示,但我想让它一排显示6个后换行显示,因水平有限,特向高手们请教帮我修改一下,本人不甚感激!现在横向显示的结果如下■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■……………………希望做成显示效果如下■ ■ ■ ■ ■ ■■ ■ ■ ■ ■ ■■ ■ ■ ■ ■ ■代码:<table width="730" height="20" border="0" align="right" cellspacing="0" style="border-width: 0px"> <tr> <td height="50" align="left" valign="middle" style="border-style: none; border-width: medium"><table width="730" height="20" border="0" cellspacing="0"> <tr> <% while ((Repeat2__numRows-- != 0) && (!chcp3fl.EOF)) { %> <td class="zt1"><A HREF="3Class.asp?<%= Server.HTMLEncode(MM_keepNone) + ((MM_keepNone!="")?"&":"") + "chcp3flID=" + chcp3fl.Fields.Item("chcp3flID").Value %>" target="_top"><%=(chcp3fl.Fields.Item("产品子类").Value)%></A></td> <% Repeat2__index++; chcp3fl.MoveNext();}%></tr> </table></td> </tr> 问题补充:要求子类显示6个后换行 </table></td> </tr> </table></td> </tr> <tr> <td height="20"> <table width="730" height="20" border="0" align="right" cellspacing="0" style="border-width: 0px"> <tr> <td height="50" align="left" valign="middle" style="border-style: none; border-width: medium"><table width="730" height="20" border="0" cellspacing="0"> <tr> <td class="zt1"><A HREF="3Class.asp?chcp3flID=182" target="_top">高压熔断器</A></td> <td class="zt1"><A HREF="3Class.asp?chcp3flID=181" target="_top">低压熔断器</A></td> <td class="zt1"><A HREF="3Class.asp?chcp3flID=183" target="_top">熔断器底座</A></td> </tr> </table></td> </tr> </table></td> </tr> <tr>
2026-12-05 06:16:56
推荐回答(1个)
回答1:


<% while ((Repeat2__numRows-- != 0) && (!chcp3fl.EOF)) { %>
" target="_top"><%=(chcp3fl.Fields.Item("产品子类").Value)%>
<%
Repeat2__index++;
chcp3fl.MoveNext();
}
%>


改为
<% while ((Repeat2__numRows-- != 0) && (!chcp3fl.EOF)) {
i = i+1
if i mod 6 = 1 Then response.write ""
%>

" target="_top"><%=(chcp3fl.Fields.Item("产品子类").Value)%>

<%
if i mod 6 = 0 Then response.write ""
Repeat2__index++;
chcp3fl.MoveNext();
}
%>