Is it possible to use the existing export function to export inline styling for cell background color for HTML export? I know I can change the background color of the text inside the cell by adding <span> styling for the contents. But I am looking to change the background color of the entire cell. I am already using a column.render function for the cells in question so they display on-screen with the appropriate background colors based on the cell contents value. Here is my working render function:
render: function (ui) {
var cellContents = {};
var lvlIn3Days = round(ui.rowData[4] - (ui.rowData[5] * 3), 2);
var attDaysLvl = round(ui.rowData[5] * ui.rowData[7] , 2);
var almDaysLvl = round(ui.rowData[5] * ui.rowData[8] , 2);
if (lvlIn3Days > attDaysLvl) { cellContents.style = 'background:#b3ff99'; }
else if (lvlIn3Days > almDaysLvl) { cellContents.style = 'background:#ffff66'; }
else if (ui.rowData[6] != 'NOT CURRENT') { cellContents.style = 'background:#ff6666'; }
if (!ui.Export) {
cellContents.text = '<span title="' +
' CurrLvl:' + ((ui.rowData[4] == null) ? '' : ui.rowData[4]) +
' ;Usage:' + ((ui.rowData[5] == null) ? '' : ui.rowData[5]) +
' ;LvlIn3Days:' + ((lvlIn3Days == null) ? '' : lvlIn3Days) +
' ;AttDaysVal:' + ((attDaysLvl == null) ? '' : attDaysLvl) +
' ;AlmDaysVal:' + ((almDaysLvl == null) ? '' : almDaysLvl) +
'" class="tooltip">' + ((ui.cellData == null) ? '' : ui.formatVal) + '<span>';
} else { cellContents.text = ui.formatVal; }
return cellContents;
}