Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change a p-dataTable border-bottom color?

PrimeNG does not let me to change for a p-dataTable the bottom-border-color when you make a select.

I tried to take the element from HTML but it does not work, and the documentation on their site is poor when it comes to style.

I want to make this change in a stylesheet.

<p-dataTable  #paperTable [custom-filters]="customFilters" id="tableId" 
scrollHeight="80%"scrollable="true" [pageLinks]="3" [value]="dataGrid"
selectionMode="single" [paginator]="true" [rowsPerPageOptions]="[25,50,100]" 
[rows]="25" [responsive]="true">
   <p-column  field="id" header="Id" [sortable]="true" [editable]="true" [hidden] = "true">
   </p-column>
</p-dataTable>
like image 423
Andrei Chivu Avatar asked Nov 30 '25 07:11

Andrei Chivu


1 Answers

PrimeNG's DataTable component has tableStyleClass attribute which can be used to add CSS class to table, for example:

.red-bottom-border {
    border-bottom: 3px solid red;
}

And then in your template:

<p-dataTable  #paperTable [custom-filters]="customFilters" id="tableId"
scrollHeight="80%" scrollable="true" [pageLinks]="3" [value]="dataGrid"
selectionMode="single" [paginator]="true" [rowsPerPageOptions]="[25,50,100]" 
[rows]="25" [responsive]="true" tableStyleClass="red-bottom-border">

You can find list of all attributes for DataTable component here.

Here's working Plunker.

like image 91
Stefan Svrkota Avatar answered Dec 02 '25 20:12

Stefan Svrkota



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!