你好,可以通过下面的代码来获取单元格内容的宽度- sheet.setValue(0,0,"TEST TEXT LENGTH");
- var instance = new GC.Spread.Sheets.CellTypes.Text();
- var returnValue = instance.getAutoFitWidth(sheet.getValue(0,0), sheet.getText(0,0), sheet.getActualStyle(0,0), sheet.zoom(), {"sheet":sheet,"row":0,"col":0,"sheetArea":GC.Spread.Sheets.SheetArea.viewport});
复制代码
然后判断与列宽之间的大小关系,大于列宽则溢出。
|