How to format a long checkboxlist into multiple rows at view?

I have a checkboxlist which will display 18 check boxes, with the default field, all check boxes are listed vertical in one column. Can I format it to show as, for example 3 check boxes, per row at the view?

You can do it with a bit of css.

Dig a bit more deeply in the forum, I remember I read something about this theme a while ago.

CSS definitely, define the checkboxes using templates, put class name in them, have a fixed width container. Then, use float:left for each checkbox’s template, at the end, remember to clear:left or clear:both.

Is there any example?

[I thin U want thse In way Using Yii Chekcbox list ]

Replay if want How to code

and Mail

me

shailesh.makwana990@gmail.com

Hi,

I have the same problem.

Can you post here an example?

I guess this is what you want.

<style>

.verticalCheckbox


{


    margin: 10px;


    width: 80%;


}





.verticalCheckbox .item


{


    float:left;


    padding:10px;


    overflow: auto;


}

</style>

<div class="verticalCheckbox">

&lt;?php


echo CHtml::checkBoxList('groups', null, CHtml::listData(


                &#036;groups, 'id', 'title'


        ), array('template' =&gt; '&lt;div class=&quot;item&quot;&gt;{input}{label}&lt;/div&gt;', 'separator' =&gt; ''));


?&gt;

</div>