views:

1709

answers:

2

I have two tables restaurants n cuisines which are related to each other as HATBM table

cusinies have certain fixed entries - 54 number

i restarurant can hve any number of cuisines. on baking the application this came with a multiple select. since i wanted check boxes i used array( 'type' => 'select', 'multiple' => 'checkbox') to convert it into checkboxes.

now i want to style the way this checkboxes are displyed into coloumns of 4 as below.

img2.pict. com/82/bc/a4/1453459/0/200908111511.png

echo $form->input('Cuisine', array('type' => 'select', 'multiple' => 'checkbox'));

the above code produces many div's around each element as follows

http://img2.pict.com/1a/a3/0a/1453457/0/200908121509.png

what i tried ?

echo $form->input('Cuisine', array( 'type' => 'select', 'multiple' => 'checkbox', 'div' => false, 'label' => false));

but this code only removes the outside divs and label. i am nota ble to control the internal

and Andhra

how to gain access through form helpers to remove or class the internal div for my custom styling. or is there any other way to populate this HABTM table to get what i want.

+1  A: 

You could get around this by doing $form->select() instead, and apply a style or class attribute to get it to look how you want.

It seems to make sense to not use the $form->input() function if you are going to remove the div and label anyway.

djcode
+1  A: 

You can stylize the DIV elements with CSS.

<style>
div.input div.checkbox {
    float: left;
    width: 50%;
}
</style>
Matt Huggins