I have an <h:outputText value="#{xx.nameame}" /> which is given below
<p:dataTable>
<p:column width="200" >
<f:facet name="header" >
<h:outputText value="Header1" />
</f:facet>
<h:panelGroup rendered="#{xx.addFlag == false}">
<h:outputText value="#{xx.nameame}" />
</h:panelGroup>
</p:column>
</p:dataTable>
I want to align the values coming for this field <h:outputText value="#{xx.nameame}" /> in left side of the cell example : text-align:left
But the problem is that JSF itself, considering the column as div tag, is assigning the the css by default which is:
.ui-dt-c {
white-space: normal;
text-align: center;
}
Due to the above, the text is aligned center. If I change the above to text-align: to left, all the datatable will get changed in other screens too.
Hence I want to apply the change only to the above datatable and not for the others.
How can I achieve it?
<td>. So highly upvoted answer is not relevant anymore in recent PF versions and you can 'just' add a style(class) on the column. And in this case a more specific selector would have helped too to apply it to just one datatable... All basic css - Kukeltje