This is only possible if the text is enclosed in a block level HTML element with the width disabled and the text disabled, and the element has the CSS property overflow:scroll or at least overflow-x:scroll defined.
So, in simple HTML expressions, this will basically be the following approach:
<div style="width: 200px; white-space: nowrap; overflow-x: scroll;"> Some really really lengthy book title about a really really lengthy book. </div>
In the PrimeFaces <p:column> options, this will be:
<p:column styleClass="scrollableCell"> #{book.title} </p:column>
from
.ui-datatable td.scrollableCell div.ui-dt-c { width: 200px; white-space: nowrap; overflow-x: scroll; }
Note that you do not need to enter any div, <p:column> already does this.
See also:
source share