Transparent background-color in PrimeFaces panelGrid

Rasshu picture Rasshu · Mar 28, 2014 · Viewed 17.6k times · Source

My panel grid in PrimeFaces has always a white background, but I couldn't find what must be changed, since I tried using a styleClass, modifying the CSS code of ui-panelgrid class, using the style tag inside p:panelGrid, p:row or p:column. Nothing worked.

Tried:

p:column style="background-color: transparent !important;"

or

.ui-panelgrid, .ui-panelgrid td { background-color: transparent !important; }

Screenshot:

panelGrid with white background inside div with gray background

Answer

Rasshu picture Rasshu · Mar 29, 2014

Thanks to a related question about removing p:panelGrid border, found out I need to override both td and tr. Background removed. Borders removed. :)

.noBorder tr,
.noBorder td { border: 0 !important; }

.transparentBackground tr,
.transparentBackground td { background: transparent !important; }

I created a custom class because the previous code did unwanted changes.