Page 1 of 1

Command Button Colors inside Datatable

Posted: 04 Feb 2019, 17:52
by glaydsongmv
How to change button colors inside datatable? If I set colors in the button still the blue color of the theme (default). Outside datatable button colors works fine.

Re: Command Button Colors inside Datatable

Posted: 06 Feb 2019, 14:30
by aragorn
Please try;

Code: Select all

body .ui-datatable tbody.ui-datatable-data .ui-button.ui-state-default {
   background: red;
    border-bottom: 5px solid blue;
}

body .ui-datatable tbody.ui-datatable-data .ui-button.ui-state-hover {
   background: yellow;
}

Re: Command Button Colors inside Datatable

Posted: 06 Feb 2019, 14:41
by glaydsongmv
Hi,

This code works coloring all buttons inside a datatable with the same color (red). I'm trying to use custom colors in different buttons with a tag styleClass="red-button" (for example).

Thanks.

Re: Command Button Colors inside Datatable

Posted: 07 Feb 2019, 08:16
by aragorn
Glad to hear, thanks a lot for the update!

Code: Select all

body .ui-datatable tbody.ui-datatable-data .red-button.ui-button.ui-state-default {
   background: red;
    border-bottom: 5px solid blue;
}

body .ui-datatable tbody.ui-datatable-data .red-button.ui-button.ui-state-hover {
   background: yellow;
}