开发者

Missing space when I change the cell's background color in SlickGrid?

开发者 https://www.devze.com 2022-12-28 14:18 出处:网络
I was trying to change cell\'s background color with custom formatter like this: var myCellFormatter = function(row, cell, value, columnDef, dataContext) {

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.

开发者_JAVA百科How could I color the whole cell ?


Add a CSS class to that column (columnDefinition.cssClass="myCell") that would set the padding of the cell to 0px.

0

精彩评论

暂无评论...
验证码 换一张
取 消