Hi,

I have the set the following decorators to render the form in a table. This is actually a subform, if it matters.


$productsForm->setDecorators(array(
           'FormElements',
array('decorator' => array('th' => 'HtmlTag'), 'options' => array('tag' => 'th')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr')), array('HtmlTag', array('tag' => 'table', 'id'=>'productsTable')),
           'Form'
       ));

$productsForm->setElementDecorators(array(
           'ViewHelper',
           'Errors',
array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')),
           array('Label', array('tag' => 'td')),
array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr')),
       ));

I want to know how to add a table row with headings using decorators.

Example output needed:
<tr><th>head1</th><th>head2</th><th>head3</th></tr>

I want this row to appear on top of other rows in the table.

The
[snip]
array('decorator' => array('th' => 'HtmlTag'), 'options' => array('tag' => 'th')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr')),
[/snip]

creates a row and adds one cell. But I don't know how to add content to that cell.


Any help is appreciated.


--

Sudheer. S
Business: http://binaryvibes.co.in, Community: http://lampcomputing.com, 
Personal: http://sudheer.net


Reply via email to