我尝试了几种方法来实现Asp.net Repeaterto在行中显示复选框。但是html表似乎没有按预期工作。有人可以帮忙吗?
<icw:Form runat="server" Caption="Action Options" ID="Form2">
<p>
Tick or un-tick roles to allow/disallow compact view</p>
<div style="width: 60%;">
<div>
<span class="headercell">Action Name</span>
<span class="headercell">Include on menu</span>
<span class="headercell">Include as button(max 3)</span>
<span class="headercell">Action button text</span>
</div>
<asp:Repeater runat="server" ID="actionSettingRepeater">
<ItemTemplate>
<div class="row">
<span class="cell">
<icw:Label ID="controlAction" runat="server" Text='<%# Eval("ControlAction")%>' />
</span><span class="cell">
<icw:CheckBox AutoPostback="true" OnValueChanged="SettingsChanged" runat="server"
ID="buttonEnabled" Checked='<%# Eval("ButtonEnabled")%>' />
</span><span class="cell">
<icw:CheckBox AutoPostback="true" OnValueChanged="SettingsChanged" runat="server"
ID="menuEnabled" Checked='<%# Eval("MenuEnabled")%>' />
</span><span>
<icw:Label ID="actionControlText" runat="server" Text='<%# Eval("Description")%>' />
</span>
<asp:HiddenField runat="server" ID="drugChartSettingId" Value='<%# Eval("DrugChartSettingID") %>' />
<div class="row">
</ItemTemplate>
</asp:Repeater>
</div>
</icw:Form>
并且应用的样式位于
之下.cell{background-color: Silver;width: 25%;display: block;float: left;border:none;text-align: left;}.headercell{width: 25%;display: block;float: left; border: none;text-align: left;} .row{clear: both;height: 5em;vertical-align: middle;}
我也尝试使用简单的html表。
<icw:Form runat="server" Caption="Action Options" ID="Form2">
<p>
Tick or un-tick roles to allow/disallow compact view</p>
<table>
<thead>
<tr>
<td>
Action Name
</td>
<td>
Include on menu
</td>
<td>
Include as button(max 3)
</td>
<td>
Action button text
</td>
</tr>
</thead>
<tbody>
<asp:Repeater runat="server" ID="actionSettingRepeater">
<ItemTemplate>
<tr>
<td>
<icw:Label ID="controlAction" runat="server" Text='<%# Eval("ControlAction")%>' />
</td>
<td>
<icw:CheckBox AutoPostback="true" OnValueChanged="SettingsChanged" runat="server"
ID="buttonEnabled" Checked='<%# Eval("ButtonEnabled")%>' />
</td>
<td colspan="1">
<icw:CheckBox AutoPostback="true" OnValueChanged="SettingsChanged" runat="server"
ID="menuEnabled" Checked='<%# Eval("MenuEnabled")%>' />
</td>
<td>
<icw:Label ID="actionControlText" runat="server" Text='<%# Eval("ControlText")%>' />
<%--<label><%# Eval("Description")%></label>--%>
</td>
<asp:HiddenField runat="server" ID="drugChartSettingId" Value='<%# Eval("DrugChartSettingID") %>' />
</tr>
</ItemTemplate>
</asp:Repeater>
</tbody>
</table>
</icw:Form>
仍然表格对齐看起来非常糟糕,如下所示。有人可以帮忙吗?