Page tree

Versions Compared

Key

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

Spread.Sheets 提供了合并单元格功能。

You can create a cell span in the cell, row header, or column header area by using the addSpan method. You can also clear cell spans using the removeSpan method.
Image Removed
The entire span is treated as an active cell when using the Tab key to move the active cell to the spanned cell. The active cell outline includes the entire span.
Using Code
This example creates a span in the header and data areas.

你可以使用  addSpan 方法以实现 “合并单元格” 功能。

你也可以在行标题栏或列标题栏中添加 Cell Span 区域。如下图所示:

Image Added

当然,如果你想清除 Cell Span,调用 removeSpan 即可。

如果你使用 Tab键切换到该合并后的单元格,合并后的单元格将会被当作一个单元格来看待。该合并后的单元格在激活的状态下时,外边框会把整个单元格围起来。

参考代码
以下代码演示了如何在标题栏区域和数据区域创建 Cell Span:

JavaScript

Copy Code

activeSheet.setRowCount(4,1);activeSheet.setColumnCount(4,2);activeSheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.colHeader);activeSheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.rowHeader);activeSheet.addSpan(0,0,3,3,GC.Spread.Sheets.SheetArea.viewport);

 

See Also
addSpan Method
SheetArea Enumeration

...