Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aligning content inside panelGrid columns

How do I align the content in the columns created by panelGrid component to the top ?

I tried with no success, the following code

<h:panelGrid columns="2" style="vertical-align:top;  " >
       <p:tabView style="margin:0px 0px 50px 0px; width: 450px; padding-top: 0px;vertical-align:top" ></p:tabView>                
       <p:menubar autoSubmenuDisplay="true" style="width: 300px; vertical-align:top" ></p:menubar>
</h:panelGrid>

But the 2 columns created hereby still remain vertically middle aligned.

like image 278
Rajat Gupta Avatar asked Jun 13 '11 05:06

Rajat Gupta


2 Answers

Based on this answer, you can do like this (I like this approach the most)

<h:panelGrid columnClasses="className">

.className {
    vertical-align: top;
}
like image 134
Dejell Avatar answered Sep 28 '22 14:09

Dejell


for me it works if you do it like that:

<h:panelGrid columns="6" cellspacing="4" cellpadding="4" styleClass="panelColumns">
</h:panelGrid>

and create a css file which contains:

.panelColumns td {
    vertical-align: top; 
} 

just as additional hint .. so you do not have to search to long :)

like image 22
joerg_wiesmann Avatar answered Sep 28 '22 14:09

joerg_wiesmann