Re: Re: HTML_Table: thead, tfoot and tbody
| From: | Mark Wiesemann | Date: | Tue, 02 Aug 2005 21:26:48 +0000 |
| Subject: | Re: Re: HTML_Table: thead, tfoot and tbody | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-39145@lists.php.net to get a copy of this message | ||
Klaus Guenther wrote:
> No, THEAD rows 0 and 2 and body rows 0 and 1 would be auto-generated (I
> think, at least). Hmm... At any rate, I think the best solution would be
> for the numbers should be unique to each section. I'll mull over it some
> more and see what I can come up with.
Here is another suggestion for this, coming back to my first suggestion:
We could add two parameters to the toHtml() method, let's say $tBodyRow
and $tFootRow, both optional. The first one indicates the row where
<tbody> should start. Lower row numbers than $tBodyRow will belong to
<thead>. If $tFootRow is given, <tbody> will end one row above this and
<tfoot> will start here. If both parameters are not given, one get's the
same result as before - no <thead>, no <tbody>, no <tfoot>. If $tBodyRow
is greater or equal to $tFootRow toHtml could return a PEAR::Error
object.
Advantages:
- no modifications in the class are needed, except in toHtml()
- very easy to use
- foolproof (no problems like those I have described last time)
- when calling toHtml() the table building should be finished => you
know which row belongs to <thead>, <tbody> or <tfoot>
Mark