CheckboxList显示对齐?

Ear*_*rlz 1 html css asp.net alignment checkboxlist

我做了一个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>
Run Code Online (Sandbox Code Playgroud)

这是一个截屏

alt text http://img718.imageshack.us/img718/6824/checkboxlist.png

CAb*_*ott 8

您可以将其包含在另一个<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>
Run Code Online (Sandbox Code Playgroud)