HTML_Table and altrowattributes
| From: | Wes Rood | Date: | Wed, 19 May 2004 20:22:00 +0000 |
| Subject: | HTML_Table and altrowattributes | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-12637@lists.php.net to get a copy of this message | ||
I am using a lot of tables in my application, so I wanted to be able to pull out the creation of the table and heading into a separate method. I will then call this method to get the table object and just add rows and call toHtml().
This works fine, except that I'd really like to also move the setting of the alternate row attributes into this method as well. The problem is that it only works if you call it *after* adding the rows to the table, not before.
To get it to work this way, the altrowattributes method would just save off the desired attributes, then use them as rows were added to the table (every other one, of course).
To maintain backwards compatibility, it would probably have to be a new method, so it wouldn't break for people currently calling altrowattributes after adding the rows.
Please let me know if this is a possible enhancement.