隐藏primefaces表列标题 [英] hide primefaces table column header
问题描述
我有一个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屋!