angus
angus

Reputation: 3320

How to add style to h:panelGrid

I have a panel grid with two columns and I want to align the right column text in the center and the left column text to the left.

I try to play with it over and over but still it’s not working

<pe:layoutPane position="south" resizable="false" closable="false" statusbar="true" spacing="0">
                <h:panelGrid columns="2" styleClass="left,centered" width="100%">
                    <h:outputText value="DEV"/>
                    <h:panelGroup>
                        <h:outputText value="Developed by "/>
                        <h:outputLink id="link1" value="mailto:[email protected]" >
                            <h:outputText value="text" style="text-decoration:underline"/>
                        </h:outputLink>
                    </h:panelGroup>
                </p:panelGrid>
            </pe:layoutPane>

Here is the css:

 .centered  {
 margin: 0px auto;
text-align: center;
 }


.left {
float: left;   
}

Any idea how could I archive this layout ??

Thanks

Upvotes: 0

Views: 11424

Answers (2)

djnose
djnose

Reputation: 945

you should better use

<h:panelGrid columns="2" columnClasses="left,centered">
...
</h:panelGrid>

greetings!

Upvotes: 2

angus
angus

Reputation: 3320

I found the solution :)

        <center>
                    <h:outputText value="DEV" style="float: left" styleClass="footer"/>
                    <h:outputText value="xxxxxxx" styleClass="footer"/>
                    <h:outputLink id="link1" value="mailto:xxxx@xxxx" styleClass="footer">
                        <h:outputText value="xxx" style="text-decoration:underline" styleClass="footer"/>
                    </h:outputLink>
                </center>

Upvotes: 0

Related Questions