0

im using JSF for J2EE projet and im looking how to limit the numbers of characters in a datatable column (h:colum; p:column). Thanks for your help and have a nice day.

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
Rod. TCH
  • 29
  • 5

1 Answers1

0

I guess you want that large text don't break in new row. My recommendation is use css:

<p:column headerText="My column" styleClass="single-line">
    <h:outputText value="#{largeTextProperty}" />
</p:column>

.single-line {
    text-wrap: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
C.P.O
  • 1,213
  • 2
  • 11
  • 29
  • Thanks for the answer. Finding 'duplicates' is good practice in Stackoverflow to prevent fragmentation. See https://stackoverflow.com/questions/9789723/css-text-overflow-in-a-table-cell – Kukeltje Nov 15 '17 at 20:03