Style

概述

Style 是 Aspose.Cells FOSS 用于 TypeScript 的一个类。继承自:StyleType。

此类为 TypeScript 程序中的 Style 对象声明了 37 个方法。可用的方法包括:constructor、getAlignment、getBackgroundColor、getBorder、getFill、getFont、getFontColor、getFontName、getFontSize、getForegroundColor、getHorizontalAlignment、getNumberFormat,以及另外 25 个方法。公共成员在安装了 Aspose.Cells 用于 TypeScript 的 FOSS 包后,可供任何 TypeScript 应用程序访问。属性:alignment、border、fill、font、numberFormat、protection。

属性

名称类型访问描述
font: Font读写获取或设置字体。
fill: Fill读写获取或设置填充。
border: Border读写获取或设置边框。
alignment: Alignment读写获取或设置对齐方式。
numberFormat: string读写获取或设置数字格式。
protection: Protection读写获取或设置保护。

方法

签名描述
constructor()在此 Style 实例上调用构造函数。
getFont() → Font返回字体。
setFont(font: Font)设置字体值。
getFill() → Fill返回填充。
setFill(fill: Fill)设置填充值。
getBorder() → Border返回边框。
setBorder(border: Border)设置边框值。
getAlignment() → Alignment返回对齐方式。
setAlignment(alignment: Alignment)设置对齐值。
setNumberFormat(format: string)设置数字格式的值。
getNumberFormat() → `stringundefined`
setProtection(protection: Protection)设置保护值。
isBold() → boolean如果已设置粗体,则返回 true。
setBold(bold: boolean)设置粗体值。
isItalic() → boolean如果斜体已设置,则返回 true。
setItalic(italic: boolean)设置 italic 值。
getFontName() → string返回字体名称。
setFontName(name: string)设置字体名称的值。
getFontSize() → number返回字体大小。
setFontSize(size: number)设置字体大小值。
getFontColor() → `stringundefined`
setFontColor(color: string)设置字体颜色值。
getForegroundColor() → `stringundefined`
setForegroundColor(color: string)设置前景色值。
getBackgroundColor() → `stringundefined`
setBackgroundColor(color: string)设置背景颜色值。
getHorizontalAlignment() → string返回水平对齐方式。
setHorizontalAlignment(alignment: Alignment["horizontal"])设置水平对齐值。
getVerticalAlignment() → string返回垂直对齐方式。
setVerticalAlignment(alignment: Alignment["vertical"])设置垂直对齐值。
isWrapText() → boolean如果已设置 wrap text,则返回 true。
setWrapText(wrapText: boolean)设置换行文本的值。
isLocked() → boolean如果已设置 locked,则返回 true。
setLocked(locked: boolean)设置锁定值。
isHidden() → boolean如果已设置 hidden,则返回 true。
setHidden(hidden: boolean)设置隐藏值。
toXml() → string对该 Style 实例调用 toXml。

另请参阅

 中文