Giving color to cells in a Grid (version 7.4.1)

How can I give color to empty cells in vaadin grid(version 7.4.1) ?
I tried the following code:
grid.setCellStyleGenerator(new Grid.CellStyleGenerator() {
public String getStyle(CellReference cellReference) {
return “red”;
return null;

in .scss {
color: red;
This is not working.

The CSS attribute “color” defines the color of the text. So your code is working, but you define that the text within the cell should be red. Since you apply the color only to cells whose content is null, you obviously won’t have any text in the cells that would get the color red.

If you want the background of the cell to be red, then change the attribute from “color” to “background-color”.