Remove all borders on a specific datatable

2019-03-26 07:53发布

问题:

I need to hide all borders of one datatable, not all, using PrimeFaces. I have tried many things and no one has worked. Does anyone know how to do it?

I have applied the following styles (separately) to the ui-datatable class:

border: hidden !important;    
border-style: none !important;

And another things...

回答1:

Assuming a PrimeFaces 3.5 data table which is marked up as follows,

<p:dataTable ... styleClass="borderless">

then this style should do:

.ui-datatable.borderless thead th,
.ui-datatable.borderless tbody,
.ui-datatable.borderless tbody tr,
.ui-datatable.borderless tbody td {
    border-style: none;
}


回答2:

with JSF 2, PrimeFaces 3.5

<p:dataTable ... styleClass="borderless">

css:

.borderless .ui-datatable thead th,
.borderless .ui-datatable tbody,
.borderless .ui-datatable tbody tr,
.borderless .ui-datatable tbody td {
    border: none;
    display: none;
}

for datatable header:

.borderless .ui-state-default,
.borderless .ui-widget-content .ui-state-default,
.borderless .ui-widget-header .ui-state-default {
    border: none;
}