CheckboxList to display aligned?

Posted by Earlz on Stack Overflow See other posts from Stack Overflow or by Earlz
Published on 2010-04-27T16:36:23Z Indexed on 2010/04/27 17:43 UTC
Read the original article Hit count: 402

Filed under:
|
|
|
|

Hello, I made a CheckboxList and it will not line up. I don't see any way to control the generated HTML. Right now, the check boxes do not align due to the widths of the <td> of each checkbox label being an automatic width. How can I set the width of this and make all the labels and checkboxes appear in two vertical aligned columns?

My code is simple:

<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>

And here is a screen shot

alt text

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about checkboxlist