Re: Help with PEAR HTML_Table
| From: | Klaus Guenther | Date: | Wed, 15 Sep 2004 20:09:13 +0000 |
| Subject: | Re: Help with PEAR HTML_Table | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14543@lists.php.net to get a copy of this message | ||
leegold2@verizon.net wrote:
I have a situation for showing one record: <table> <tr> <td>title</td><td>author</td><td>price</td> </tr> <tr> <td>description</td> </tr> </table> Since description is about a paragraph of text you can see the layout I want. Of course this block would be a PHP loop pulling from an array php/Mysql "result" query. How can I implement this with HTML_Table? I see the excellent example in the HTML_Table intro. doc. but it applies to a case were each "tr" is one record. In my case a record is two "tr's" in a table(?) or is there another way w/HTML_table that's better?foreach ($records as $record) { .... $table->addRow(array($value1, $value2, $value3)); $row_desc = $table->addRow(array($description)); $table->updateCellAttributes($row_desc, 0, array('colspan' => 3)); .... } RTM for more information. It is quite informative. However, the best introduction to HTML_Table, even if it is a bit outdated, is on Bertrand's site: http://www.mamasam.com/index3.html Alter to suit your needs :-) Klaus