I would like to know how to set up background color for a specific column in a datatable.I have tried the below css code
.mystyle.ui-datatable .ui-datatable-data td, .mystyle.ui-datatable .ui-datatable-data td{
background-color:#B5D3A5;
}
But the above seems to change the background color for all the columns in the datatable. Please let me know how to change the background color for a specific column in the datatable. Thanks in Advance
You can use the
styleandstyleClassattributes ofp:columnfor this:This will colorize table cells and header cells.
If you don’t want to change header cells you could do the following:
Give the column a styleClass attribute:
And then add the following style definition to your css/html: