Page tree

Versions Compared

Key

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

Spread.Sheets supports text decoration. You can specify a line below, above, or through the text using the textDecoration method.支持文本修饰属性。你可以使用 textDecoration 方法设置文本的上划线,删除线和下划线。

Using Code
The following example adds a line above the text in cell 示例代码
以下代码给位于 (0,0), a line below and above the text in cell 的单元格中的文字加入了一条上划线, 给位于(1,0)单元格中的文字加了下划和上划线, and a line above, below, and through the text in cell (0,1).

JavaScript

Copy Code

activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).textDecoration(GC.Spread.Sheets.TextDecorationType.Underline);activeSheet.getRange(1, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).textDecoration(GC.Spread.Sheets.TextDecorationType.Overline

GC.Spread.Sheets.TextDecorationType.Underline);activeSheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).textDecoration(GC.Spread.Sheets.TextDecorationType.Overline

GC.Spread.Sheets.TextDecorationType.LineThrough

GC.Spread.Sheets.TextDecorationType.Underline); var style = new GC.Spread.Sheets.Style();style.textDecoration = GC.Spread.Sheets.TextDecorationType.Overline

GC.Spread.Sheets.TextDecorationType.Underline;activeSheet.setStyle(1, 1, style, GC.Spread.Sheets.SheetArea.viewport);activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).value("Test");activeSheet.getCell(1, 0, GC.Spread.Sheets.SheetArea.viewport).value("Test");activeSheet.getCell(0, 1, GC.Spread.Sheets.SheetArea.viewport).value("Test");

 

See Also
TextDecorationType Enumeration
Style class