SpreadJS Documentation
Adding a Watermark
SpreadJS Documentation > Developer's Guide > Customizing the Appearance > Adding a Watermark

You can display a watermark in an empty cell.

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