asp for循环td 好难啊着急死了求解

xiaoyanzbx 2014-12-31 01:37:13
<center>
<table style="width: 60%;" align="center">
<tr>
<th style=" border: 1px solid #F2F7FA;font-size: x-large ; border-bottom-style : none ;background-color: #F2F7FA; color: #003366;">排名</th>
<th style=" border: 1px solid #F2F7FA; font-size: x-large ;border-bottom-style : none;background-color: #F2F7FA;color: #003366;">活动</th>
</tr>
<tr>
<td style="font-size: x-large; border: 1px solid #F2F7FA;border-right:none;border-bottom-style : none" >1</td>
<td class="TestStyle"style=" border: 1px solid #F2F7FA;border-bottom-style : none">
<asp:Label ID="lbl1" runat="server"></asp:Label></td>


</tr>
<tr>
<td style="font-size: x-large; border: 1px solid #F2F7FA;border-right:none;border-bottom-style : none" >2</td>
<td class="TestStyle"style=" border: 1px solid #F2F7FA;border-bottom-style : none">
<asp:Label ID="lbl2" runat="server"></asp:Label></td>
</tr>
<tr>
<td style="font-size: x-large; border: 1px solid #F2F7FA;border-right:none;border-bottom-style : none" >3</td>
<td class="TestStyle"style=" border: 1px solid #F2F7FA;border-bottom-style : none">
<asp:Label ID="lbl3" runat="server"></asp:Label></td>

</tr>
<tr>
<td style="font-size: x-large; border: 1px solid #F2F7FA;border-right:none;border-bottom-style : none" >4</td>
<td class="TestStyle"style=" border: 1px solid #F2F7FA;border-bottom-style : none">
<asp:Label ID="lbl4" runat="server"></asp:Label></td>

</tr>
<tr>
<td style="font-size: x-large; border: 1px solid #F2F7FA;border-right:none;border-bottom-style : none" >5</td>
<td class="TestStyle"style=" border: 1px solid #F2F7FA;border-bottom-style : none">
<asp:Label ID="lbl5" runat="server"></asp:Label></td>

</tr>
<tr>
<td class="auto-style1" style="font-size: x-large; border: 1px solid #F2F7FA;border-right:none;border-bottom-style : none" >6</td>
<td class="TestStyle"style=" border: 1px solid #F2F7FA;border-bottom-style : none">
<asp:Label ID="lbl6" runat="server"></asp:Label></td>

</tr>
<tr>
<td style="font-size: x-large; border: 1px solid #F2F7FA;border-right:none;border-bottom-style : none" >7</td>
<td class="TestStyle"style=" border: 1px solid #F2F7FA;border-bottom-style : none">
<asp:Label ID="lbl7" runat="server"></asp:Label></td>

</tr>
<tr>
<td style="font-size: x-large; border: 1px solid #F2F7FA;border-right:none;border-bottom-style : none" >8</td>
<td class="TestStyle"style=" border: 1px solid #F2F7FA;border-bottom-style : none">
<asp:Label ID="lbl8" runat="server"></asp:Label></td>

</tr>
<tr>
<td style="font-size: x-large; border: 1px solid #F2F7FA;border-right:none;border-bottom-style : none" >9</td>
<td class="TestStyle"style=" border: 1px solid #F2F7FA;border-bottom-style : none">
<asp:Label ID="lbl9" runat="server"></asp:Label></td>

</tr>
<tr>
<td style="font-size: x-large; border: 1px solid #F2F7FA; border-right:none;" >10</td>
<td class="TestStyle"style=" border: 1px solid #F2F7FA;border-right:none;">
<asp:Label ID="lbl10" runat="server"></asp:Label></td>

</tr>
</table>
</center>






怎么循环出来呢着急
...全文
399 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
於黾 2014-12-31
  • 打赏
  • 举报
回复
没看到你后面的文字到底从哪里绑定出来的 反正<%%>就代表里面是C#语法了
於黾 2014-12-31
  • 打赏
  • 举报
回复

<%
for(int i=0;i<10;i++)
{
%>
 <tr>
<td style="font-size: x-large; border: 1px  solid #F2F7FA;border-right:none;border-bottom-style : none" ><%#=(i+1)%></td>
<td  class="TestStyle"style=" border: 1px  solid #F2F7FA;border-bottom-style : none">
<asp:Label ID=<%#="lbl"+(i+1)%> runat="server"></asp:Label></td>
</tr>
<%
}
%>
xiaoyanzbx 2014-12-31
  • 打赏
  • 举报
回复
那个lbl也要循环显示的啊
xiaoyanzbx 2014-12-31
  • 打赏
  • 举报
回复
大神能不能详细点。。。。我是新手
於黾 2014-12-31
  • 打赏
  • 举报
回复
<% for(int i=0;i<10;i++) { %> <标签/> <% } %>

4,819

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧