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!
You can solved that with custom CSS by setting the thead display attribute to none:
Example:
div[id="testForm:first"] thead {
display:none;
}
if your JSF is similar to this:
<h:form id="testForm">
<p:dataTable id="first">
...
<p:/dataTable>
</h:form>
If your <p:dataTable>
uses columns widths like this
<p:dataTable styleClass="myTable">
<p:column width="100">
and you use the following CSS to hide the column headers
.myTable thead {
display:none;
}
you will also lose the column widths you set
Solution to hide column header and keep column widths
.myTable thead th {
border: none !important;
background: none !important;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With