Pellizon
Pellizon

Reputation: 1375

How do I modify the Datatable header style in PF Dynamic Columns?

I'm trying to apply a css rule to the header of a datatable.
The problem is that i'm using Dynamic Columns (<p:columnS>), and i don't know how to apply a css rule only for the header.

When i try to set the style property for p:column it also change the row style.

<p:columns var="a" width="40" style="text-align:center;color:red" ....>

And when i try to set only the th on the css rule, it doesn't work:

<p:columns var="a" width="40" style="text-align:center" styleClass="test" ... >

.test th {
    color:red;
}

Also, i can't just make a rule like #table th {...}, because the rules of the header style depends on each dynamic column. That would be something like:

<p:columns var="a" width="40" style="text-align:center" styleClass="#{a.style}" ...>

.style1{....}

Suggetions??

Upvotes: 0

Views: 1109

Answers (1)

Jaqen H&#39;ghar
Jaqen H&#39;ghar

Reputation: 4345

I think you can do

th[role=columnheader] {
     background-image: none;
     ....
}

Upvotes: 1

Related Questions