Basic formatting of a datatable?

UI Components for Angular
Post Reply
richleach
Posts: 16
Joined: 21 Jan 2018, 01:59

26 Apr 2018, 17:50

Hi

I'm trying to apply some styles to a datatable component.

Specifically I'm trying to change the color of the background of the headers of all the columns. As close as I've gotten is applying:

[style]="{'width':'4rem','background-color':'red'}"

to the p-column tag (nested inside of the p-table tag) but that applies the color to the entire column, I just need the headers affected.

Thank you in advance for your help.

Rich

User avatar
Ctrl-C
Posts: 97
Joined: 29 Sep 2016, 04:21

26 Apr 2018, 18:11

I think you're better off with some custom css here. Datatable is deprecated and no changes/fixes will be made to it.

richleach
Posts: 16
Joined: 21 Jan 2018, 01:59

26 Apr 2018, 22:12

Sounds like a good idea, but I'm having a little trouble getting a hold of a starting point.... any ideas?

Thanks,

Rich

User avatar
Ctrl-C
Posts: 97
Joined: 29 Sep 2016, 04:21

26 Apr 2018, 23:00

Play with .ui-datatable th.ui-state-default - that's where background comes from.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 17 guests