直接上代码:
window.onload = function () {
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 1 });
var activeSheet = spread.getActiveSheet();
activeSheet.addSpan(2,2,8,1)
activeSheet.setValue(2,2,"SpreadJS中文");
$("#btnTopDown").click(function(){
var style = new GC.Spread.Sheets.Style();
style.hAlign = GC.Spread.Sheets.HorizontalAlign.center;
style.vAlign = GC.Spread.Sheets.VerticalAlign.center;
activeSheet.setStyle(2,2,style,GC.Spread.Sheets.SheetArea.viewport);
activeSheet.setValue(2,2,activeSheet.getValue(2,2).split('').join(' '+String.fromCharCode(10))) ;
activeSheet.getCell(2,2).wordWrap(true);
});
};
|
|