In my application, I have the following
:
The 2nd column
Try this
<f:facet name="header">
<h:outputLabel value="Number of Sessions" style="white-space:pre;"/>
</f:facet>
If using the "Number of Sessions" from properties file, try the below in your properties file ...
myString = Number of \
Sessions
If it's CSS, you could have a <br/>
tag after 'Number of'.
I just saw your edited post.
What you're doing in Firebug is actually 'editing text'
However, what you need to do is 'Right click' and then 'Edit HTML'. This way when you insert the
tag, the text would break and shift onto the next line.
First of all, you need to remove the headerText
attribute from the column and add a header facet inside it:
/* no_of_sessions = Number of Sessions */
<p:column ... >
<f:facet name="header">
<h:outputText value="#{l10n.no_of_sessions}"
escape="false" style="white-space:pre-line;" />
</f:facet>
...
</p:column>
The escape="false"
is relevant so html is escaped, then you can put anything you want in there. If you just want to style content, this is not needed
The simplest answer for this is to add white-space:pre-line in the style attribute. See the below code
<p:column headerText="Number of Sessions" style="white-space:pre-line;width:50px;">
<h:outputText value="#{value}"></h:outputText>
</p:column>