[]
        
(Showing Draft Content)

GC.Spread.Sheets.Tables.TableStyle

类: TableStyle

Sheets.Tables.TableStyle

Table of contents

构造方法

属性

构造方法

constructor

new TableStyle(backColor?, foreColor?, font?, borderLeft?, borderTop?, borderRight?, borderBottom?, borderHorizontal?, borderVertical?, textDecoration?, fontStyle?, fontWeight?, fontSize?, fontFamily?)

表格样式信息

代码示例

//本示例创建了一个表
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tableStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(
    "black",
    "white",
    "bold 11pt arial",
    new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin),
    new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick),
    new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.thin),
    new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.thick),
    new GC.Spread.Sheets.LineBorder("pink", GC.Spread.Sheets.LineStyle.thin),
    new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.thick),
    GC.Spread.Sheets.TextDecorationType.overline | GC.Spread.Sheets.TextDecorationType.underline);
tableStyle.headerRowStyle(tableStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);

参数

属性名 类型 说明
backColor? string | IGradientFill | IGradientPathFill | IPatternFill 表格背景色
foreColor? string 表格前景色
font? string 字体
borderLeft? LineBorder 表格的左边框线
borderTop? LineBorder 表格的上边框线
borderRight? LineBorder 表格的右边框线
borderBottom? LineBorder 表格的下边框线
borderHorizontal? LineBorder 表格的水平边框线
borderVertical? LineBorder 表格的垂直边框线
textDecoration? TextDecorationType 表格的文本修饰
fontStyle? string
fontWeight? string
fontSize? string
fontFamily? string

属性

backColor

backColor: string | IGradientFill | IGradientPathFill | IPatternFill

背景色

代码示例

//本示例创建了一个表
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium);
tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.headerRowStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);

borderBottom

borderBottom: LineBorder

表格的下边框线

代码示例

//本示例创建了一个表
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium);
tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.headerRowStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);

borderHorizontal

borderHorizontal: LineBorder

Indicates the horizontal border line of the table.

代码示例

//本示例设置borderHorizontal属性
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderHorizontal = new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderVertical = new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.firstRowStripStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);

borderLeft

borderLeft: LineBorder

表格的水平边框线

代码示例

//本示例创建了一个表
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium);
tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.headerRowStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);

borderRight

borderRight: LineBorder

表格的右边框线

代码示例

//本示例创建了一个表
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium);
tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.headerRowStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);

borderTop

borderTop: LineBorder

表格的上边框线

代码示例

//本示例创建了一个表
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium);
tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.headerRowStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);

borderVertical

borderVertical: LineBorder

表格的垂直边框线

代码示例

//本示例设置borderHorizontal属性
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderHorizontal = new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderVertical = new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.firstRowStripStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);

font

font: string

字体

代码示例

//本示例创建了一个表
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium);
tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.headerRowStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);

fontFamily

fontFamily: string

Indicates the font family.

代码示例

//This example sets the fontFamily property.
var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'));
var activeSheet = spread.getActiveSheet();
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var wholeTableStyle = new GC.Spread.Sheets.Tables.TableStyle();
wholeTableStyle.fontFamily = "Arial Black";
tableStyle.wholeTableStyle(wholeTableStyle);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);

fontSize

fontSize: string

Indicates the font size.

代码示例

//This example sets the fontSize property.
var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'));
var activeSheet = spread.getActiveSheet();
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var wholeTableStyle = new GC.Spread.Sheets.Tables.TableStyle();
wholeTableStyle.fontSize = "16px";
tableStyle.wholeTableStyle(wholeTableStyle);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);

fontStyle

fontStyle: string

Indicates the font style.

代码示例

//This example sets the fontStyle property.
var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'));
var activeSheet = spread.getActiveSheet();
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var wholeTableStyle = new GC.Spread.Sheets.Tables.TableStyle();
wholeTableStyle.fontStyle = "italic";
tableStyle.wholeTableStyle(wholeTableStyle);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);

fontWeight

fontWeight: string

Indicates the font weight.

代码示例

//This example sets the fontWeight property.
var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'));
var activeSheet = spread.getActiveSheet();
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var wholeTableStyle = new GC.Spread.Sheets.Tables.TableStyle();
wholeTableStyle.fontWeight = "bold";
tableStyle.wholeTableStyle(wholeTableStyle);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);

foreColor

foreColor: string

前景色

代码示例

//本示例设置borderHorizontal属性
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderHorizontal = new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderVertical = new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.firstRowStripStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);

textDecoration

textDecoration: TextDecorationType

文本修饰 代码示例

//This example sets the textDecoration property.
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.font = "bold 11pt arial";
tStyleInfo.textDecoration = GC.Spread.Sheets.TextDecorationType.doubleUnderline;
tableStyle.firstRowStripStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);