【发布时间】:2013-02-27 11:01:42
【问题描述】:
我正在尝试调整 HTML 表中作为 ASP 转发器项目持有者的列的宽度。
<asp:Repeater id="viewproduct" runat="server">
<HeaderTemplate>
<table id="grid">
<thead >
<tr>
<th width="20px" data-field="check"></th>
<th data-field="level">Status</th>
<th data-field="Class">Username</th>
</tr>
</thead>
<tbody>``
</HeaderTemplate>
<ItemTemplate>
<tr>
<td width="20px"><asp:CheckBox ID="CheckApprove" runat="server" Width="20px" /></td>
<td><asp:Label ID="status" runat="server"
Text='<%#DataBinder.Eval(Container.DataItem, "Status")%>'></asp:Label></td>
<td><asp:Label ID="name" runat="server"
Text='<%#DataBinder.Eval(Container.DataItem, "name")%>'></asp:Label></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
请注意,标题跟随宽度,但内容不跟随。为什么? 这是我的桌子目前的样子:
【问题讨论】:
-
为什么不用 CSS 来设置呢。
-
您能向我们展示您生成的 HTML 的相关 sn-p 吗?
-
从图像上看,似乎您没有向我们展示所有代码。看起来用户名右侧至少还有一列。我之所以提到这一点,是因为如果您的桌子上有更多内容,它可能会帮助我们找到问题。
标签: html asp.net html-table repeater