The cell appends the class name

Tags: #<Tag:0x00007f8b1d999918>

Hey, how can I add a different CSS class name to a cell instead of overwriting it
https://jsfiddle.net/3ta1j057/4/

HI @7458115

This is correct way to do this if you want to be sure that it will not cause any problems. We do not recommend other solutions as we can’t guarantee they will work correctly.

@adrian.szymanski However, this cannot achieve the desired effect, so how can I add the style? 1. Font size 2. Font color 3. Background color 4. Others… How do I add one by one instead of overwriting the previous style

Hi @7458115

one cell can have multiple classes like here https://jsfiddle.net/AMBudnik/eyqa5kox/
You can use native classList to add and remove classes https://developer.mozilla.org/en-US/docs/Web/API/Element/classList. We do not have any dedicated API for that operation.

If you would have any further questions please let me know.

@aleksandra_budnik Hi, you may have misunderstood, what I need is to operate on a single cell, not all

@7458115 you can apply classList logic to a single cell as well. It does not change anything. Here https://stackoverflow.com/questions/507138/how-to-add-a-class-to-a-given-element is a related topic. As I mentioned that is native JavaScript - Handsontable only gives you the element itself but className-operation can be done using the native classList property.