Styling Table Visualization

Question : How to add CSS Styles to a Spotfire Table ?
Answer   : I have a Code 😊
We need to add below code in a TextArea -
<style>
.sfc-style-root .sf-element-table-cell.sfpc-odd-row {
   background-color: chocolate;
   color: white;}
.sfc-style-root .sf-element-table-cell {
background-color: burlywood;
}

</style>
Now, for poor guys with HTML Sanitization issues 😐 : Add a JavaScript (below). It is basically same code as above with a trick to add css.
if(!$('#AlienBox').length){
$('body').append($(`<style id="AlienBox">
.sfc-style-root .sf-element-table-cell.sfpc-odd-row {
   background-color: chocolate;
   color: white;}
.sfc-style-root .sf-element-table-cell {
background-color: burlywood;
}
</style>`, {
        id: 'AlienBox'
   }));
}
Look, What I got (I know its basic - but more can be done, right ??)

Share: