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

橙三吉。 提交于 2019-12-07 09:36:44

问题


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:


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



来源:https://stackoverflow.com/questions/2746417/missing-space-when-i-change-the-cells-background-color-in-slickgrid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!