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
}