How to remove border from specific PrimeFaces p:panelGrid?

前端 未结 15 1626
再見小時候
再見小時候 2020-12-02 15:27

I have difficulty in removing border from a specific PrimeFaces .


    &l         


        
相关标签:
15条回答
  • 2020-12-02 15:50

    Please try this too

    .ui-panelgrid tr, .ui-panelgrid td {
    border:0 !important;
    }
    
    0 讨论(0)
  • 2020-12-02 15:51

    Just add those lines on your custom css mycss.css

    table tbody .ui-widget-content {
        background: none repeat scroll 0 0 #FFFFFF;
        border: 0 solid #FFFFFF;
        color: #333333;
    }
    
    0 讨论(0)
  • 2020-12-02 15:51

    As mentioned by BalusC, the border is set by PrimeFaces on the generated tr and td elements, not on the table. However when trying with PrimeFaces version 5, it looks like there is a more specific match from the PrimeFaces CSS .ui-panelgrid .ui-panelgrid-cell > solid which still result in black borders being shown when appyling the style suggested.

    Try using following style in order to overide the Primefaces one without using the !important declaration:

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

    As mention make sure your CSS is loaded after the PrimeFaces one.

    0 讨论(0)
  • 2020-12-02 15:52

    Try

    <p:panelGrid styleClass="ui-noborder">
    
    0 讨论(0)
  • 2020-12-02 15:56

    I placed the panelgrid inside datatable, and hence my working solution is

    .ui-datatable-scrollable-body .myStyleClass tbody td{border:none;}
    

    for

    <h:panelGrid  styleClass="myStyleClass" >...</h:panelGrid>
    
    0 讨论(0)
  • 2020-12-02 16:04

    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;
    }
    
    0 讨论(0)
提交回复
热议问题