Help Needed A newbie - How to align form elements in a single row

kunal981 - March 8, 2008 - 10:41

Hello,
I am new to Drupal , i am creating a new module in which i had a registration form created. When i insert form elements like the textbox, checkbox or radio buttons they all come in the next row. No two form elements come in same column. I am really confused.
Please help me to make to form elements come in single column.
Thanks

HiYou can use prefix and

krishnarp - March 8, 2008 - 11:01

Hi
You can use prefix and suffix .
For example

       $form['serial'] = array(
                '#type' => 'textfield',
                '#title' => t('serial number'),
                '#prefix' => '<table><tr><td>',
                '#suffix' => '</td>',
        );

        $form['submit'] = array (
                '#type' => 'submit',
                '#value' => t('Submit'),
                '#prefix' => '<td>',
                '#suffix' => '</td></tr></table>',
        );

Thanks

 
 

Drupal is a registered trademark of Dries Buytaert.