如何显示2行中的一列中的数据表? [英] How to show 2 line in one column in datatable?
本文介绍了如何显示2行中的一列中的数据表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的应用程序中的数据表。一列有大数据,增加表格的宽度。
I have a data table in my application. One column have heavy data which increasing the width of table.
欲分割该列中的数据,以两个或更多个线路。
I want to split the data to two or more lines in that column.
我已通过设置宽度为该列但数据我以前不分裂和不显示总的数据尝试。
I have tried by setting width for that column but data did't split and doesn't show total data.
<p:column headerText="#{msgs['exception.label.exceptionMsg']}" width="200">
<h:outputText value="#{exception.exceptionMsg}"/>
</p:column>
如何将数据拆分?
推荐答案
在 .UI-数据表TBODY TD
有一个默认样式涂白空间:NOWRAP
,这意味着长文本不会换行。你想通过设置回空白覆盖此风格:正常
The .ui-datatable tbody td
has a default style of white-space: nowrap
, meaning that long texts won't wrap. You want to override this style by setting it back to white-space: normal
.
例如。
<p:column width="200" styleClass="wrap">
这个CSS
with this CSS
.ui-datatable tbody td.wrap {
white-space: normal;
}
参见:
- <一个href="http://stackoverflow.com/questions/8768317/how-do-i-override-those-classes-defined-in-primefaces-css/8774997#8774997">How我覆盖primefaces.css定义这些类?
- How do I override those classes defined in primefaces.css?
See also:
这篇关于如何显示2行中的一列中的数据表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文