日期:2014-05-18  浏览次数:20825 次

repeater如何循环出正方形的表格啊?
怎么用repeater生成出下面这样的啊?
HTML code
<table width="400" border="1" cellspacing="3" cellpadding="3">
  <tr>
    <td>1</td>
    <td>2</td>
    <td>3</td>
    <td>4</td>
  </tr>
  <tr>
    <td>5</td>
    <td>6</td>
    <td>7</td>
    <td>8</td>
  </tr>
  <tr>
    <td>..</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>


------解决方案--------------------
<asp:Repeater ID="repeater" runat="server">
<HeaderTemplate>
<table width="400" border="1" cellspacing="3" cellpadding="3">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%# ((DataRowView)Container.DataItem)["ApplyEmpName"]%>
</td>
<td>
<%# ((DataRowView)Container.DataItem)["EquipTypeName"]%>
</td>
<td>
<%# ((DataRowView)Container.DataItem)["ApplyTypeText"]%>
</td>
<td>
<%# ((DataRowView)Container.DataItem)["ApplyCount"]%>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>

数据源中的属性名