rich中的列宽:datatable [英] column width in rich:datatable

查看:134
本文介绍了rich中的列宽:datatable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 rich:datatable 中为 rich:column 设置列的宽度?将忽略 width 属性。请参阅以下代码:

 < rich:column label =#{msg [result]}width =150px > 
< f:facet name =header>
< h:outputText value =#{veryLongText}/>
< / f:facet>
< h:outputText value =#{someValue}/>
< f:facet name =footer>
< h:outputText value =#{someValue}/>
< / f:facet>
< / rich:column>

如果您呈现此列,并且 veryLongText 宽度超过150px它不打破它在多行。



如何解决这个问题?

解决方案

尝试< rich:column> headerClass 属性,如下:

 < rich:column headerClass =myWidth> 
...
< / rich:column>然后,在您的CSS(嵌入或链接)中:


$ b

$ b

  .myWidth {width:150px} 

您也可能有某些违反空白CSS属性的地方,所以你可能想要指定 .myWidth 选择器如下:

  .myWidth {width:150px; white-space:normal!important} 


How to set the colum width for a rich:column inside a rich:datatable ? The width attribute is being ignored. See the following code:

<rich:column label="#{msg[result]}" width="150px">
<f:facet name="header">
    <h:outputText value="#{veryLongText}"/>
</f:facet>
<h:outputText value="#{someValue}" /> 
<f:facet name="footer">
    <h:outputText value="#{someValue}" /> 
</f:facet>
</rich:column>

If you render this column and veryLongText is wider than 150px it does not break it in multiple lines. Instead, it just ignores the column width and takes as much as space needed.

How to fix this?

解决方案

Try the <rich:column>'s headerClass attribute, as so:

<rich:column headerClass="myWidth">
...
</rich:column>

Then, in your CSS (embedded or linked):

.myWidth {width:150px}

You may also have some contravening "white-space" CSS property coming into play somewhere, so you might want to specify the .myWidth selector as so:

.myWidth {width:150px; white-space:normal!important}

这篇关于rich中的列宽:datatable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆