How to remove border from specific PrimeFaces p:panelGrid?

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

I have difficulty in removing border from a specific PrimeFaces .


    &l         


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

    Nowdays, Primefaces 5.x have a attribute in panelGrid named "columnClasses".

    .no-border {
        border-style: hidden !important ; /* or none */
    }
    

    So, to a panelGrid with 2 columns, repeat two times the css class.

    <p:panelGrid columns="2" columnClasses="no-border, no-border">
    

    To other elements, the ugly " !important " is not necessary, but to the border just with it work fine to me.

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

    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

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

    If BalusC answer doesn't work try this:

    .companyHeaderGrid td {
         border-style: hidden !important;
    }
    
    0 讨论(0)
  • 2020-12-02 15:47

    for me only the following code works

    .noBorder tr {
    border-width: 0 ;
    }
    .ui-panelgrid td{
        border-width: 0
    }
    
    <p:panelGrid id="userFormFields" columns="2" styleClass="noBorder" >
    </p:panelGrid>
    
    0 讨论(0)
  • 2020-12-02 15:48

    This worked for me:

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

    If you find a line in between the columns then use the below code,

    .panelNoBorder, .panelNoBorder tr, .panelNoBorder td{
    border: hidden;
    border-color: white;
    }
    

    I checked this with Primefaces 5.1

    <h:head>
         <title>Login Page</title>    
         <h:outputStylesheet library="css" name="common.css"/>
    </h:head> 
    
    <p:panelGrid id="loginPanel" columns="3" styleClass="panelNoBorder">
    <p:outputLabel value="Username"/> <p:inputText id="loginTextUsername"/>
    <p:outputLabel value="Password"/> <p:password id="loginPassword"/>
    <p:commandButton id="loginButtonLogin" value="Login"/> <p:commandButton id="loginButtonClear" value="Clear"/>
    </p:panelGrid>  
    
    0 讨论(0)
提交回复
热议问题