Forum Moderators: coopster

Message Too Old, No Replies

PEAR HTML_QuickForm question

         

orion_rus

8:45 pm on Mar 9, 2005 (gmt 0)

10+ Year Member



Hello world i need to know how to make output form.
Now ouput making like this:
<tr><td>label1</td><td>value1</td></tr>
<tr><td>label2</td><td>value2</td></tr>
I need to make output like this:
<tr><td>label1</td><td>value1</td>
<td>label2</td><td>value2</td></tr>

Thanks for helping me

coopster

12:39 pm on Mar 10, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Depends on where the data is coming from, but in any case, the solution is quite the same. Loop through the entries and print them out. An example, using an array:
$array = array( 
'label1' => 'value1',
'label2' => 'value2'
);
print '<tr>';
foreach ($array as $label => $value) {
print "<td>$label</td><td>$value</td>";
}
print '</tr>';

orion_rus

1:58 pm on Mar 10, 2005 (gmt 0)

10+ Year Member



HTML_QuickForm uses templates and renderers, i can't make so(