SpreadJS Documentation
setColumnName Method
The column index of the table header. The index is zero-based.
The header text.
Sets the table header text with the specified table index.
Syntax
var instance = new GcSpread.Sheets.SheetTable(name, row, col, rowCount, colCount, style);
var value; // Type: SheetTable
value = instance.setColumnName(tableColumnIndex, name);
function setColumnName( 
   tableColumnIndex : string,
   name : string
) : SheetTable;

Parameters

tableColumnIndex
The column index of the table header. The index is zero-based.
name
The header text.

Return Value

The table.
Example
This example uses the setColumnName method.
//Add data
for (var col = 1; col < 6; col++) {
    for (var row = 2; row < 11; row++) {
        activeSheet.setValue(row, col, row + col);
    }
}

var sTable = activeSheet.addTable("table1", 1, 1, 10, 5, GcSpread.Sheets.TableStyles.medium2());
sTable.showFooter(true);
sTable.setColumnName(4, "SUM");
//set footer value
sTable.setColumnValue(0, "Total");
//set footer formula
sTable.setColumnFormula(4, "SUM(F3:F11)");
See Also

Reference

SheetTable type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.