SpreadJS 13
SpreadJS Documentation / Developer's Guide / Features / Customize Appearance / Watermark
In This Topic
    Watermark
    In This Topic

    You can display a watermark in an empty cell.

    Cell containing a watermark

    Create a Style object and set the watermark property. Use the setStyle method to apply the style to a cell, row, or column.

    Text will not overflow into a cell that contains a watermark.

    Using Code

    This example displays a watermark in cell B1 and B2.

    JavaScript
    Copy Code
    var type = new GC.Spread.Sheets.Style();
    type.watermark = "User name";
    sheet.setStyle(0, 1, type);
    var type = new GC.Spread.Sheets.Style();
    type.watermark = "Password";
    sheet.setStyle(1, 1, type);
    
    See Also