adding class to td in HTML_Quickform
| From: | Michael Larocque | Date: | Thu, 27 Apr 2006 15:20:04 +0000 |
| Subject: | adding class to td in HTML_Quickform | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-23862@lists.php.net to get a copy of this message | ||
Hi all,
I'm relatively new to PEAR. My first usage involves HTML_Quickform. I'm using it to create a very simple form.
The following php snippet:
parent::HTML_QuickForm('formContact', 'post');
$this->addElement('text', 'name', 'Name');
$this->addRule('name', 'A name is required', 'required');
...
produces the following html snippet:
<tr>
<td align="right" valign="top"><span style="color: #ff0000">*</span><b>Name</b></td>
<td valign="top" align="left"><input name="name" type="text" /></td>
</tr>
What I'd like to do is to add a 'class="foo"' to the first td (i.e. the label) so that I can style it, and optionally remove the 'align' and 'valign' bits. i.e.:
<tr>
<td class="foo"><span style="color: #ff0000">*</span><b>Name</b></td>
<td valign="top" align="left"><input name="name" type="text" /></td>
</tr>
Is there a simple way of doing this? Any help greatly appreciated.
Carpe viam,
Mike
Michael Larocque
Chief Cook and Bottle Washer
Prolumina Communications Inc.
http://prolumina.com/~mlarocque/