spacing and justified wrapping of extra-long radio button labels with label-for markup

106 views Asked by At

ASP.NET renders a list of radio buttons as rows in table with inputs in the cell, like this:

    <table id="sites">
    <tr>
        <td>
           <input id="sites_11" type="radio" name="sites" value="1583" />
          <label for="sites_11">This is a very long site name including city and state</label>
         </td>

    </tr>
          .
          .
          <snip>
    </table>

I am trying to create some space between the input ( ) and its label so that this crowding

    ( )This is the beginning of a long label

becomes this:

    ( )  This is the beginning of a long label

Also, since the labels are very long, and many of them wrap, I'd like to have the wrap not extend beneath the (). I'd like it to look like this:

    ( ) This is a very long label for the site which includes
        the city and state 

not like this:

       ( ) This is a very long label for the site which includes 
       the city and state 

How is that achieved?

1

There are 1 answers

0
Kurt Sample On

You could try creating a CSS class and apply it to your radiobuttonlist, with a label sub-class that contains your desired formatting. Something like:

.yourradioliststyle label {
padding-left:5px;

}