i use this class for create HTML content
http://code.google.com/p/php-class-html-generator/
I try to build a table in this way , but the html result is wrong…
$messalist = array(...);
$html = htmltag::createElement('table')->id( $attr['id'] );
foreach($messagelist as $message){
$html->addElement('tr')
->addElement('td')->setText($message['subject'])
->addElement('td')->setText($message['from'])
->addElement('td')->setText($message['date'])
->addElement('td')->setText($message['size']);
}
echo $html;
How do it in right way?
Thanks
This is generated html:
<table id="messagelist">
<tr>
<td>
<td>
<td>
<td>1.91kB</td>23 Feb 11:56 AM</td>To: me@me.com</td>Re: helooo</td></tr>
<tr>
<td>
<td>
<td>
<td>1.67kB</td>27 Feb 6:56 AM</td>me@me.com</td>Re: Helloo</td></tr></table>
and this is what i need:
<table id="messagelist">
<tr>
<td>1.91kB<td></td>23 Feb 11:56 AM</td><td>To: me@me.com</td><td>Re: helooo</td></tr>
<tr>
<td>1.67kB</td><td>27 Feb 6:56 AM</td><td>me@me.com</td><td>Re: Helloo</td></tr></table>
Try: