function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chris Baker 12Chris Baker 12 

Change color of table header in Lightning

I am using data tables from https://www.lightningdesignsystem.com/components/data-tables/#site-main-content

By default the table headers are gray. I was wondering how I could change the background color of the table headers. 
Best Answer chosen by Chris Baker 12
Raj VakatiRaj Vakati
You can do it by using your own style and override it 
 
<table class="slds-table slds-table_bordered slds-table_resizable-cols slds-table_fixed-layout slds-table_edit mystles" role="grid" style="width: 66.75rem;">

	
	</table>
 
.mystles{
		
		
		 background-color: :red !importance ;
	}

 

All Answers

Raj VakatiRaj Vakati
You can do it by using your own style and override it 
 
<table class="slds-table slds-table_bordered slds-table_resizable-cols slds-table_fixed-layout slds-table_edit mystles" role="grid" style="width: 66.75rem;">

	
	</table>
 
.mystles{
		
		
		 background-color: :red !importance ;
	}

 
This was selected as the best answer
Chris Baker 12Chris Baker 12
Thank you. I actually had to put it in my <th> like this, bnut it worked.  <th class="mystles">
Chris Baker 12Chris Baker 12
Thank you. I actually had to put it in my
but it is working now