Last updated December 22, 2008. Created by Gribnif on December 22, 2008.
Log in to edit this page.
The two themes also accept a number of other optional parameters, which change the appearance of the final output.
- #form_panel_div_attributes (form_panel_div theme only)
- This array of attributes is added the that wraps each form element. The theme also adds its own class, form-panel-div, to the class attribute.
- #form_panel_number_cols (both themes)
- If TRUE, a class of the name form-panel-col-NNN, where NNN is from 000 to 999, is added to each
<div>,<td>, or<th>that wraps each form element. This allows you to give each column of the output a different style. - #form_panel_number_rows (both themes)
- If TRUE, a class of the name form-panel-row-NNN, where NNN is from 000 to 999, is added to each
<div>or<tr>that wraps a row. This allows you to give each row of the output a different style. - #form_panel_odd_even (both themes)
- If TRUE, the same two classes "odd" and "even" that are used in other tables generated by Drupal are also added to the rows of output this module generates. This allows you to give alternating rows a slightly different appearance.
- #form_panel_table_attributes (form_panel_table only)
- This array of attributes is added the
<table>tag. The theme also adds its own class, form-panel, to the class attribute. - Changing the list of attributes other than "class" can give you a quick way to control some of the table's appearance (border, cellspacing, etc.) without using CSS, though this is generally not considered good practice in modern Web design.
- #form_panel_table_caption (form_panel_table only)
- This attribute contains an optional caption, which appears at the top of the table.
- #form_panel_table_filler (form_panel_table only)
- When generating a table with missing cells, it is sometimes necessary to include empty (
<td></td>) cells. But some browsers will not render an empty cell the same as those with contents, so the value of this attribute will be inserted into the cell. - If not specified, this attribute defaults to the string
. - #form_panel_table_span_rows (form_panel_table only)
- If TRUE, merge missing cells downward, instead of to the right.
- #form_panel_td_attributes (form_panel_table only)
- This array of attributes is added the
<td>that wraps each form element. The theme also adds its own class, form-panel-cell, to the class attribute. - #form_panel_tr_attributes (form_panel_table only)
- This array of attributes is added the
<tr>that wraps each form element. The theme also adds its own class, form-panel-row, to the class attribute.
An Example Using Attributes:
<?php
$form = array(
'#theme' => 'form_panel_table',
'#form_panel_table_attributes' => array(
'border' => 1,
'class' => 'my-table'),
);
$i = ord('A');
$form[chr($i)] = array('#value' => chr($i++), '#weight' => 2001);
$form[chr($i)] = array('#value' => chr($i++), '#weight' => 2002);
$form[chr($i)] = array('#value' => chr($i++), '#weight' => 3002);
print drupal_render($form);
?>