Missing space when I change the cell's backgro

2019-05-06 11:39发布

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 ?

1条回答
姐就是有狂的资本
2楼-- · 2019-05-06 12:14

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

查看更多
登录 后发表回答