我做了一个CheckboxList,它不会排队。我看不到任何控制生成的 HTML 的方法。现在,由于 <td>
的宽度,复选框没有对齐每个复选框标签都是自动宽度。我如何设置它的宽度并使所有标签和复选框出现在两个垂直对齐的列中?
我的代码很简单:
<div style="text-align: center;">
<p>
Here you will tell..
</p>
<asp:CheckBoxList runat="server" ID="cbl" Width="300px"></asp:CheckBoxList>
<br />
<input type="button" id="next_3" value="Next Page" />
</div>
这是截图
最佳答案
您可以将其包含在另一个 <div>
中像这样左对齐:
<div style="text-align: center;">
<p>Here you will tell..</p>
<div style="text-align: left; width: 50%; margin: auto;">
<asp:CheckBoxList runat="server" ID="cbl" Width="300px"></asp:CheckBoxList>
</div>
<input type="button" id="next_3" value="Next Page" />
</div>
关于asp.net - CheckboxList 显示对齐?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2723077/