做几个小总结 (官方文档,请戳这里https://www.grapecity.com.cn/developer/spreadjs)
表格赋值
sheet.setValue()
表格对齐方式
.hAlign(0).vAlign(1)
//hAlign 列 vAlign 行
//0 靠左 1居中 2靠右 3水平对齐
表格锁定,禁止输入
sheet.getRange(1,1,1,1).locked(false)
//getRange选择表格位置
//locked 里面的参数,false表示没锁定,就是可以输入,true表示锁定,不可输入
表格样式,设置字体大小
官方的技术博客https://www.grapecity.com.cn/blogs/spreadjsdanyuangezitishezhi
style.font = 'italic small-caps bold 20pt/22pt "Times New Roman",Georgia,Serif'; //官方例子是这样
style.font = '12px "Times New Roman",Georgia,Serif';//实际可以简写成这样,如果设置字体大小的话,字号和字体是必填的
列表宽度
官方文档说明https://demo.grapecity.com.cn/spreadjs/help/docs/dynamic-column-size.html
sheet.setColmnWidth(2,'1.5*')
//第二列,1.5加权比例