隐藏primefaces表列标题 [英] hide primefaces table column header

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

问题描述

我有一个p:treeTable,树的内容都在一列中.该树是一个共享组件,因此我的某些页面需要列标题,而有些则不需要.在columnHeader为空的页面中,它为列标题创建了一个空行,这是我不想要的.我确实想要列的内容,但是当没有列标题时,就不要标题了.

I have a p:treeTable and the tree contents are all in one column. The tree is a shared component so some of my pages require column header and and some don't. In the pages where the columnHeader is empty, it creates the an empty row for the column header, which I don't want. I do want the column contents, just not the header when there is no column header.

我该如何解决?任何指针/想法都会很棒.谢谢!

How can I fix this? Any pointers/ideas would be great. Thanks!

推荐答案

您可以通过将thead display属性设置为none来使用自定义CSS来解决此问题:

You can solved that with custom CSS by setting the thead display attribute to none:

示例:

div[id="testForm:first"] thead {
    display:none;
}

如果您的JSF与此类似:

if your JSF is similar to this:

<h:form id="testForm">
    <p:dataTable id="first">
        ...
    <p:/dataTable>
</h:form>

这篇关于隐藏primefaces表列标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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