jsf - Applying CSS classes only to the parent (current) p:panelGrid -
the following <p:panelgrid> contains <p:panelgrid>s.
<p:panelgrid columns="2" styleclass="panelgrid-noborder"> <p:panelgrid columns="1"> <h:outputtext value="1"/> <h:outputtext value="2"/> </p:panelgrid> <p:panelgrid columns="1"> <h:outputtext value="1"/> <h:outputtext value="2"/> </p:panelgrid> </p:panelgrid> just example, need remove borders parent/outer(most) <p:panelgrid>.
the following css class,
.panelgrid-noborder.ui-panelgrid tr, .panelgrid-noborder.ui-panelgrid .ui-panelgrid-cell { border: none; } removes borders <p:panelgrid>s.
i tried using plain css class like,
.panelgrid-noborder { border: none; } and give columnclasses attribute - columnclasses="panelgrid-noborder" not remove borders @ all.
how remove borders parent <p:panelgrid> i.e css classes should applied current <p:panelgrid> theses classes specified? should not affect other <p:panelgrid>s.
the selector .panelgrid-noborder.ui-panelgrid tr means "match every <tr> of element having class panelgrid-noborder ui-panelgrid".
you want match immediate child. need use more specific selector that, child combinator selector e > f.
so, should do:
.panelgrid-noborder.ui-panelgrid > tbody > tr, .panelgrid-noborder.ui-panelgrid > tbody > tr > td { border: none; } please note browsers implicitly put <tr> elements in <tbody> when no <thead> or <tfoot> specified. can see in browser's html dom tree inspector.
Comments
Post a Comment