Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

当行或者列的 resizable 为 false 时,AutoFit 会失效。

你也可以使用 autoFitColumn 方法, autoFitRow 方法和 Commands 类来对行和列进行自适应大小操作。

...

Image Removed

...

你也可以使用 autoFitColumn 方法, autoFitRow 方法和 Commands 类来对行和列进行自适应大小操作。

Image Added

 wordWrap 为 true 时,你可以使用 Alt+Enter 来输入多行文字。

示例代码

以下代码将给列重新设置了宽度。 This example fits the width of the column to the text.

...

JavaScript

...

Copy Code

Code Block
languagejs
titleJavaScript
activeSheet.setValue(0, 1, "testing");
activeSheet.autoFitColumn(1);

...

 

示例代码

以下代码给行重新设置了高度。

Code Block
languagejs
titleJavaScript

...

Copy Code

activeSheet.setValue(0, 1, "testing\r\nmultiple\r\nlines");
activeSheet.getCell(0,1).wordWrap(true);activeSheet.autoFitRow(0);

...

 


另见

Workbook Method