Add background colour to table headers dynamically

Tags: #<Tag:0x00007efc60a0c860>

Hey there,
Does anyone know how to change the background color of the header of Handsontable? I need to change the header colors dynamically based on some conditions. I’m using handsontable React.

Thanks.

Hi @pasinduprabashitha

Here’s an example of how you can change the background color. You can do this by creating a custom renderer and setting it as a cell property in cells option.

http://jsfiddle.net/Le25ogc5/

But this code colorizes the second row instead of the header. I’m using React. Is that be the issue?

@adrian.szymanski Here’s the picture of the current look.

Hi @pasinduprabashitha

My colleague is on vacation now so I wanted to make an update for him.
We do not have an exact demo in our demo base but you can use this example https://jsfiddle.net/handsoncode/0gfjkesd and alter the emoji logic for a className and then manipulate the coloring of a header via className.