SpreadJS Documentation
Changing the Sheet Names
SpreadJS Documentation > Sample Code > Sample Code for the Sheet > Changing the Sheet Names

You can change the name of the sheets.

Using Code

This example changes the sheet name and sets the sheet tab color.

JavaScript
Copy Code


$(document).ready(function () {
 var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3});
// Set the number of sheets to 5.
spread.setSheetCount(5);

// Change the sheet names
spread.sheets[0].name("The first sheet");
spread.sheets[1].name( "The second sheet");

// Change sheet information such as sheet tab display color.
spread.sheets[0].options.sheetTabColor = "LemonChiffon";
});