I need to hide all borders of all panelGrids using primefaces. The following code remove the borders on all panelGrids and dataTables too (primefaces 5+):
.ui-pa
Your CSS selectors are to 'broad'. They influence all Use e.g. This only targets If you don't want this applied to all panelgrids, You'll have to use the styleClass referred to in a comment above by @BhavinPanchani. But instead of explicitly adding borders by using a class, you prevent the css above to be applied. Just add the See also and tags that are descendants of a .ui-panelgrid
, including all that are in a table that is in a panelgrid cell as descendants of the table that makes the datatable. So you have to make your selectors more specific (read about css specificity on mozdev) and have them only target a certain level .
.ui-panelgrid > * > tr, .ui-panelgrid > * > tr > td.ui-panelgrid-cell {
border: none;
}
's that are a grandchild of a .ui-panelgrid
and its direct children.
.ui-panelgrid:not(.keepBorder) > * > tr, .ui-panelgrid:not(.keepBorder) > * > tr > td.ui-panelgrid-cell {
border: none;
}
keepBorder
class to the panelGrids that you want to keep the border. I did not test this last thing, but with a little testing you;