autoFitColumn是根据文本内容来调整列宽
代码如下:
activeSheet.setValue(0, 1, "testing");
activeSheet.autoFitColumn(1);
autoFiteRow 根据文本来调整行宽度,不知道您使用是否正确,示例代码:
activeSheet.setValue(0, 1, "testing\r\nmultiple\r\nlines");
activeSheet.getCell(0,1).wordWrap(true);
activeSheet.autoFitRow(0); |