How to align a particular cell inside a h:panelGrid
in jsf 2.0开发者_开发知识库. I am able to align whole table by adding style in the h:panelGrid
. But I need only one cell to be aligned center.
Thanks
BrajeshIf you want to say that you need only one column (through the word cell
) to be aligned center, use columnClasses
<h:panelGrid columns="3" columnClasses="basicStyle, centerStyle, basicStyle"
CSS
.basicStyle {
/*text-align: inherit; optinal*/
}
.centerStyle{
text-align: center;
}
Edit: Align only one cell
Declare a new grid just for the cell you want to align:
<h:panelGrid columns="2" width="800px">
<h:outputText value="#test" />
<h:outputText value="#test" />
<h:panelGrid columnClasses="centerStyle" width="100px">
<h:outputText value="#test" />
</h:panelGrid>
<h:outputText value="#test" />
<h:outputText value="#test" />
<h:outputText value="#test" />
</h:panelGrid>
精彩评论