Re: Re: HTML_Table: thead, tfoot and tbody
| From: | Bertrand Mansion | Date: | Wed, 03 Aug 2005 08:50:47 +0000 |
| Subject: | Re: Re: HTML_Table: thead, tfoot and tbody | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-39155@lists.php.net to get a copy of this message | ||
Christian Weiske wrote:
>Hi Mark,
>
>> $table->setCellContents(0, 0, '<tbody> row before <thead> row');
>> $table->setHeaderContents(1, 0, '<thead> row after <tbody>
>> row');
>> $table->setFooterContents(2, 0, '<tfoot> row before <tbody>
>> row');
>> $table->setCellContents(3, 0, '<tbody> row after <tfoot> row');
>> How can this be rendered? When putting row 1 in <thead>, rows 0 and 3 in
>
>That means:
>thead: Row 1 of thead is set, but 0 is not set. Just fill it up?
>tbody: Row 0 and Row 3 of tbody are set. How does the class currently
>behave? Just fill it up with empty rows? If yes, then it should be so.
>tfoot: Row 2 of tfoot is set. Just fill the missing rows up?
>
>The question is how does the class currently behave if the user does
>such things - it should be copied. (As head, body and foot are totally
>differen arrays [with the same width]), this has to be calculated 3 times).
It fills with empty cells by default unless the user specifies not to, in which
case she takes the responsability for it.
I suggest you just create an HTML_Table2 package. Even if the API is not
different, adding such features will add so much to the code that it is IMO
justified to go for a new major version.
In terms of implementation, having 3 different structure arrays, 1 for thead,
tfoot and tbody, will make it easier to manage. This way, using
setHeaderContents() or setBodyContents() (an alias of setCellContents()), you
won't have to remember where your header stops and where your body starts. Every
section starts at row 0, col 0.
Problems might be with col/row spans, any ideas ?
Bertrand Mansion
Mamasam