Dave Burke - Freelance .NET Developer specializing in Online Communities

A freelance .NET Developer

Formatting CheckBoxLists with CSS. Finding some space.

I needed a multi-column CheckBoxList the other day and encountered the old CheckBox-Butt-up-Against-The-Text syndrome.  I added some string manipulation hack the last time I dealt with this, but determined to do it differently this time.

Simply put, I let CSS do the work.  Probably an obvious approach to most ASP.NET developers, but it case it ain't.....

<asp:CheckBoxList id="chklstMembers" Runat="server" RepeatDirection="Vertical" RepeatColumns="4" RepeatLayout="Table"
 Width="800" CssClass="chkbox" />

and

.chkbox INPUT
{
 COLOR: black;
 border-style: none;
 font-family: Tahoma;
 font-size: 11px;
 margin-right: 5px
}


 

Comments

Jamie said:

Thank you, I was looking everywhere for this!

# March 14, 2008 5:31 PM

Anka said:

Easy and nice, Thank you

# August 26, 2011 2:34 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)