SpreadJS Documentation
setColumnWidth Method
The column index.
The width in pixels.
The sheet area. If this parameter is not given, it defaults to viewport.
Sets the width in pixels for the specified column in the specified sheet area.
Syntax
var instance = new GcSpread.Sheets.Sheet(name);
var returnValue; // Type: any
returnValue = instance.setColumnWidth(col, value, sheetArea);
function setColumnWidth( 
   col : number,
   value : number,
   sheetArea : SheetArea
) : any;

Parameters

col
The column index.
value
The width in pixels.
sheetArea
The sheet area. If this parameter is not given, it defaults to viewport.
Example
This example sets the column width.
sheet.setValue(0, 0, "value");
sheet.addRows(0, 2);
sheet.addColumns(0, 2);
sheet.setRowHeight(0, 50.0,GcSpread.Sheets.SheetArea.viewport);
sheet.setColumnWidth(0, 150.0,GcSpread.Sheets.SheetArea.viewport);
sheet.getRow(0).backColor("Gray");
sheet.getColumn(0).backColor ("Brown");
See Also

Reference

Sheet type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.