Alex Rivera | Logout

How to align items in a <h:panelGrid> to the right

Asked 2010-09-15T01:50:17.913
12

How would I align everything in my below to the far right?

<div id="container">    
     <h:form id="authenticate">
        <h:panelGrid columns="5" cellpadding="6">
             <h:inputText id="email" value="" />
             <p:watermark for="email" value="Email"/>
             <h:inputSecret id="password" value="" />
             <p:watermark for="password" value="Password"/>
             <p:commandButton id="login" value="Login" align="right"/>
        </h:panelGrid>
     </h:form>
</div>
Edit
Report

1 Answer

0

A little late, but might help someone, as it was what I needed...

If the alignment is not limited to this specific table, but rather the default format for all table cells, then just add this to your CSS file:

td {
    text-align: right;
}

Then, all <td> elements, including those generated by JSF, will be formatted that way.

answered 2013-07-26T12:05:59.997

Your Answer