I was trying to change cell's background color with custom formatter like this:
var myCellFormatter = function(row, cell, value, columnDef, dataContext) {
if ((row + cell) % 5 == 1) {
return "<div style='background-color:green'>" + value + "</div>";
} else {
return value;
}
};
but this does not color the whole cell.
There is some space between cell's div
and the div
in the formatter.
How could I color the whole cell ?
I was trying to change cell's background color with custom formatter like this:
var myCellFormatter = function(row, cell, value, columnDef, dataContext) {
if ((row + cell) % 5 == 1) {
return "<div style='background-color:green'>" + value + "</div>";
} else {
return value;
}
};
but this does not color the whole cell.
There is some space between cell's div
and the div
in the formatter.
How could I color the whole cell ?
Share Improve this question edited May 16, 2013 at 0:01 madth3 7,34412 gold badges52 silver badges74 bronze badges asked Apr 30, 2010 at 17:26 Misha MoroshkoMisha Moroshko 172k230 gold badges520 silver badges760 bronze badges 1- I found an efficient way to set styles on SlickGrid cells, without using an inner div. It's not trivial, but it does work well: stackoverflow./a/36562844/218294 – Sam Watkins Commented Apr 12, 2016 at 3:06
1 Answer
Reset to default 4Add a CSS class to that column (columnDefinition.cssClass="myCell"
) that would set the padding of the cell to 0px.