Re: HTMLQuickForm: how can I add/mark a CSS class to the table generated by QuickForm?

From: Date: Wed, 03 Aug 2005 07:57:16 +0000
Subject: Re: HTMLQuickForm: how can I add/mark a CSS class to the table generated by QuickForm?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-20239@lists.php.net to get a copy of this message
l Burnerheimerton wrote: > I have pages with other tables that I DO NOT want to > be affected by the style I assign to the QF generated > table. > > Specifically, I want to add cellpadding and perhaps > alter other design elements as I learn more about CSS. > > How can I assign a CSS class to the table that is > generated by QuickForm? CSS selectors help you out here, so you won't have to add style or class definitions at QF level. Put your Form inside a container element: <div id="formContainer"> [QuickForm goes here] </div> In your CSS definition use selectors to style elements inside formContainer: #formContainer table { [table properties go here] } #formContainer td { [table cell properties go here] } If the table is always nested inside the form element, you don't even need to use the container. Just use the form element as a CSS selector, so all tables nested inside forms will be styled the same way: form table { [table properties go here] } form td { [table cell properties go here] } > What about the <TR> tag? You can style the tr element, but I am not sure about browser support. I personnally always style the td elements, not the tr element. -- Markus

« previous php.pear.general (#20239) next »