<asp:checkboxlist runat="server" id="chkBoxList1" cssclass="chkBoxList" repeatcolumns="4" repeatlayout="Table">
</asp:checkboxlist>
Here we explicitly define the layout to be rendered as table (which is by default) and also need to define the css class "chkBoxList" in current page or web site theme.
<style>
.chkBoxList tr
{
height:24px;
}
.chkBoxList td
{
width:120px; /* or percent value: 25% */
}
</style>
Of course any other css styles can be attached here.
Only ASP.NET :)
Thanks dear ... it helped
ReplyDeleteIt works!!!! Thank you :)
ReplyDeleteExcellent!!
ReplyDeleteExcellent!!
ReplyDeleteit's not working.. i'm using dynamic CheckboxList
ReplyDeleteWhat do you mean with "dynamic". The final HTML output of the CheckBoxList control consist of table cells and they can be easily manipulated via css td classes. Use firbug or other tool so inspect the control outpus and check the css associated to the table cell.
ReplyDeleteYup. Now it's working. the problem is that i am using repeat Layout "FLOW" instead of "TABLE".
DeleteThanks..
Thanks. Worked for me.
ReplyDeleteIt works!!!! Thank you :)
ReplyDeleteAwesome. Lots of wrong information on the web about this, thanks for getting it right.
ReplyDeleteFantastic and EASY solution posted in a quick and easy way ... no twelve pages of text to explain the checkbox list rendering a table which like any other, can be manipulated with CSS. Great, works, is clear and simple. Kudos & Thanks!
ReplyDeleteIt works !!! Thanks !!!
ReplyDeleteSimple and very helpful Thanks!
ReplyDeleteThanks a lot !!!!!!!! Very helpful
ReplyDelete