gpt4 book ai didi

asp.net - 水平对齐复选框(表格布局)

转载 作者:技术小花猫 更新时间:2023-10-29 11:49:02 25 4
gpt4 key购买 nike

我有复选框,如 http://jsfiddle.net/Lijo/Fw3fz/ 所示。 .我需要水平对齐复选框。如何使用 CSS 对齐它们?

注意:以下 HTML 代码是从 ASP.NET 生成的。我无法更改此 HTML 代码。

<table id="Checkboxlist1">
<tr>
<td><input id="Checkboxlist1_0" type="checkbox" name="Checkboxlist1$0" value="red" /><label for="Checkboxlist1_0">Red</label></td>
</tr><tr>
<td><input id="Checkboxlist1_1" type="checkbox" name="Checkboxlist1$1" value="blue" /><label for="Checkboxlist1_1">Blue</label></td>
</tr><tr>
<td><input id="Checkboxlist1_2" type="checkbox" name="Checkboxlist1$2" value="green" /><label for="Checkboxlist1_2">Green</label></td>
</tr>
</table>

最佳答案

创建一个 CheckBoxList 并设置水平布局属性:

<asp:CheckBoxList ID="cbl" runat="server" RepeatDirection="Horizontal">
<asp:ListItem>Red</asp:ListItem>
<asp:ListItem >Blue</asp:ListItem>
<asp:ListItem>Green</asp:ListItem>
</asp:CheckBoxList>

更多信息:

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.checkboxlist.repeatdirection.aspx

关于asp.net - 水平对齐复选框(表格布局),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10821533/

25 4 0
文章推荐: internet-explorer - 如何在 Internet Explorer 中旋转
文章推荐: linux - uniq -c 不适用于 awk?
文章推荐: 将 `ip tuntap add` system() 调用转换为 C 代码
文章推荐: html - CSS:没有的垂直列布局