How to render a form as a table

Fgrxmdeasq

New Member
I've created a form that has the following structure\[code\]function myfunction(){ $form['myform']['row1']['field1'] = array( //type, title, etc. ); $form['myform']['row1']['field2'] = array( //type, title, etc. ); $form['myform']['row1']['field3'] = array( //type, title, etc. ); $form['myform']['row2']['field1'] = array( //type, title, etc. ); $form['myform']['row2']['field2'] = array( //type, title, etc. ); $form['myform']['row2']['field3'] = array( //type, title, etc. ); }\[/code\]but I'd like to render it as a table in the following format with a head row if possible. \[code\] Col 1 Col 2 Col 3---------------------------------------------------------------------- Row 1 Field 1 Field 2 Field 3Row 2 Field 1 Field 2 Field 3Row 3 Field 1 Field 2 Field 3\[/code\]What format should I follow to get Drupal to render the form as a table?P.S. \[code\]Col 1 = select\[/code\], \[code\]Col 2 = checkbox\[/code\], \[code\]Col 3 = texfield\[/code\] and the very first column is the \[code\]row #\[/code\] \[code\]Row1, Row2, Row3\[/code\].Edit: doesn't drupal have something that you could give it a form and it will automatically produce that colored row, white row look?
 
Back
Top