How to make radioButtonList appear in horizontal mode?

Hi, How to make radioButtonList appear in horizontal mode?. thanks

I don’t know the code generated by radioButtonList, but the idea is to edit css styles:

selector { display: inline; margin-right: 10px; }

thanks andy, i’ll try it

I had to solve this problem too, so I wrote a small wiki article on it:

Yii Wiki: Styling Radio Buttons

Nice job, thank you.

here’s how to do it without modifying your php or html:

$htmlOptions=array('separator'=>'');//to prevent printing <br/>

please try this


 echo $form->radioButtonList($model, 'field',

                    array(  0 => 'Unapproved',

                            1 => 'Deleted',

                            2 => 'Approved' ),



    'labelOptions'=>array('style'=>'display:inline'), // add this code

    'separator'=>'  ',

) );


I did it with css:

in the view:

<td><div class="compactRadioGroup">

and in css/main.css

DIV#content DIV.compactRadioGroup {

padding-left: 1em;


DIV#content .compactRadioGroup LABEL,

DIV#content .compactRadioGroup INPUT {

display: inline;


Thanks a lot…

Nisanth thulasi thank you so much

you can use this for more space


thanks Nisanth thulasi