ng2-smart-table icon indicating copy to clipboard operation
ng2-smart-table copied to clipboard

How to change the header color from blue to something else.

Open jayeshiitr opened this issue 7 years ago • 6 comments

Hi folks, This can be a very naive question. Bear with me for that. I could change the color of other cells; but not able to change the color of the header. I have tried this :host /deep/ ng2-smart-table thead > tr > th { color: red; } But this changed the color of the 'Actions' but not of the sortable column headers. They still appears in blue. I want to change to #BF3D1A . I tried this too: :host{ /deep/ { *{ font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

   table{
    color: $table-font-color;  
    tr {
        td,th{
           border: 1px solid $table-border-color; 
             color: #BF3D1A;
           a: {
             color: #BF3D1A;
           }
        }
    }
   }
}

} }

My data looks like this settings = { columns: { stageNo: { title: 'Stage #', filter:false }, stageName: { title: 'Stage Description', filter:false, class: "{color:red}" }, startDate: { title: 'Start Date (DD/MM/YYYY)', filter:false }, endDate: { title: 'End Date (DD/MM/YYYY)', filter:false } } };

Any help is greatly appreciated !

jayeshiitr avatar Jun 30 '17 10:06 jayeshiitr

set defaultStyle in table settings object see below: settings = { defaultStyle: false, attr: { class: 'responstable' // this is custom table scss or css class for table },

and set in your custom css or scss file th { color: #000000; // black padding: 1em; a{ color: #000000; // black } a:hover { color: #fff; // white text-decoration: none; // for remove under line of link } Thanks Avinash

avighoga avatar Jul 17 '17 08:07 avighoga

I am trying what @avighoga said, however the default blue styling is still there...

janpansa avatar Jul 20 '17 14:07 janpansa

Try :host /deep/ ng2-smart-table-title > a { color: red; }

chlehtin avatar Aug 07 '17 18:08 chlehtin

@chlehtin @avighoga I managed to fix my issues a few days ago by using :host and /deep/ . See here #464 .

janpansa avatar Aug 07 '17 18:08 janpansa

Try this: in Settings, attr:{class: 'table table-striped changeTableHeaderColor'}

define the class in the custom scss file: .changeTableHeaderColor{ ng2-smart-table-title { color: #ffffff !important; } }

Hope this helps

Deddoh avatar Jul 17 '21 10:07 Deddoh

this worked for me in angular: add this following code to styles.css

ng2-smart-table table tr th a { color: red !important; }

josephjoju2 avatar Nov 30 '22 07:11 josephjoju2