Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove border from specific PrimeFaces p:panelGrid?

I have difficulty in removing border from a specific PrimeFaces <p:panelGrid>.

<p:panelGrid styleClass="companyHeaderGrid">
    <p:row>
        <p:column>
            Some tags
        </p:column>
        <p:column>
            Some tags
        </p:column>
    </p:row>
</p:panelGrid>

I have been able to remove border from the cells with:

.companyHeaderGrid td {
    border: none;
}

But

.companyHeaderGrid {
    border: none;
}

Does not work.

like image 877
Eleeist Avatar asked May 02 '12 20:05

Eleeist


4 Answers

The border is been set on the generated tr and td elements, not on the table. So, this should do:

.companyHeaderGrid.ui-panelgrid>*>tr,
.companyHeaderGrid.ui-panelgrid .ui-panelgrid-cell {
    border: none;
}

How I found it? Just check the generated HTML output and all CSS style rules in the webdeveloper toolset of Chrome (rightclick, Inspect Element or press F12). Firebug and IE9 have a similar toolset. As to the confusion, just keep in mind that JSF/Facelets ultimately generates HTML and that CSS only applies on the HTML markup, not on the JSF source code. So to apply/finetune CSS you need to look in the client (webbrowser) side instead.

enter image description here

See also:

  • How do I override default PrimeFaces CSS with custom styles?
  • Remove border from all PrimeFaces p:panelGrid components

If you're still on PrimeFaces 4 or older, use below instead:

.companyHeaderGrid.ui-panelgrid>*>tr,
.companyHeaderGrid.ui-panelgrid>*>tr>td {
    border: none;
}
like image 97
BalusC Avatar answered Nov 15 '22 05:11

BalusC


I am using Primefaces 6.0 and in order to remove borders from my panel grid i use this style class "ui-noborder" as follow:

<p:panelGrid columns="3" styleClass="ui-noborder">
   <!--panel grid contents -->
</p:panelGrid>

It uses a css file named "components" in primefaces lib

like image 20
Mr.Q Avatar answered Nov 15 '22 06:11

Mr.Q


This worked for me:

.ui-panelgrid td, .ui-panelgrid tr
{
    border-style: none !important
}
like image 21
Mohammed Pasha Avatar answered Nov 15 '22 06:11

Mohammed Pasha


If BalusC answer doesn't work try this:

.companyHeaderGrid td {
     border-style: hidden !important;
}
like image 12
Paul Wasilewski Avatar answered Nov 15 '22 07:11

Paul Wasilewski