...
当行或者列的 resizable 为 false 时,AutoFit 会失效。
你也可以使用 autoFitColumn 方法, autoFitRow 方法和 Commands 类来对行和列进行自适应大小操作。
...
...
你也可以使用 autoFitColumn 方法, autoFitRow 方法和 Commands 类来对行和列进行自适应大小操作。
当 wordWrap 为 true 时,你可以使用 Alt+Enter 来输入多行文字。 |
示例代码
以下代码将给列重新设置了宽度。 This example fits the width of the column to the text.
...
JavaScript
...
Copy Code
Code Block | ||||
---|---|---|---|---|
| ||||
activeSheet.setValue(0, 1, "testing"); activeSheet.autoFitColumn(1); |
...
示例代码
以下代码给行重新设置了高度。
Code Block | ||||
---|---|---|---|---|
|
...
Copy Code
activeSheet.setValue(0, 1, "testing\r\nmultiple\r\nlines"); activeSheet.getCell(0,1).wordWrap(true);activeSheet.autoFitRow(0); |
...