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?
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
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">
<?php
echo CHtml::checkBoxList('groups', null, CHtml::listData(
$groups, 'id', 'title'
), array('template' => '<div class="item">{input}{label}</div>', 'separator' => ''));
?>
</div>