表资源类型Table resource type

表示一个 Excel 表。Represents an Excel table.

方法Methods

方法Method 返回类型Return Type 说明Description
Get TableGet Table WorkbookTableWorkbookTable 读取 table 对象的属性和关系。Read properties and relationships of table object.
Create TableColumnCreate TableColumn WorkbookTableColumnWorkbookTableColumn 通过发布到列集合创建新的 TableColumn。Create a new TableColumn by posting to the columns collection.
List columnsList columns WorkbookTableColumn 集合WorkbookTableColumn collection 获取 TableColumn 对象的集合。Get a TableColumn object collection.
Create TableRowCreate TableRow WorkbookTableRowWorkbookTableRow 通过发布到行集合创建新的 TableRow。Create a new TableRow by posting to the rows collection.
List rowsList rows WorkbookTableRow 集合WorkbookTableRow collection 获取 TableRow 对象的集合。Get a TableRow object collection.
UpdateUpdate WorkbookTableWorkbookTable 更新 Table 对象。Update Table object.
DatabodyrangeDatabodyrange 区域Range 获取与表的数据体相关的 range 对象。Gets the range object associated with the data body of the table.
HeaderrowrangeHeaderrowrange 区域Range 获取与表的标头行相关的 range 对象。Gets the range object associated with header row of the table.
区域Range 区域Range 获取与整个表相关的 range 对象。Gets the range object associated with the entire table.
TotalrowrangeTotalrowrange 区域Range 获取与表的总计行相关的 range 对象。Gets the range object associated with totals row of the table.
ClearfiltersClearfilters None 清除当前表上应用的所有筛选器。Clears all the filters currently applied on the table.
ConverttorangeConverttorange 区域Range 将表转换为普通单元格区域。保留所有数据。Converts the table into a normal range of cells. All data is preserved.
删除Delete None 删除表。Deletes the table.
ReapplyfiltersReapplyfilters None 重新应用当前表上的所有筛选器。Reapplies all the filters currently on the table.
ListList WorkbookTable 集合WorkbookTable collection 获取 table 对象的集合。Get table object collection.
AddAdd WorkbookTableWorkbookTable 创建一个新表。区域源地址确定将在其下添加表的工作表。如果无法添加表(例如,由于地址无效,或者表与另一个表重叠),将抛出错误。Create a new table. The range source address determines the worksheet under which the table will be added. If the table cannot be added (e.g., because the address is invalid, or the table would overlap with another table), an error will be thrown.

属性Properties

属性Property 类型Type 说明Description
idid stringstring 返回用于唯一标识指定工作簿中表的值。Returns a value that uniquely identifies the table in a given workbook. 即使表被重命名,标识符的值仍保持不变。The value of the identifier remains the same even when the table is renamed. 应将此属性解析为不透明的字符串值,不得将它解析为其他任何类型。This property should be interpreted as an opaque string value and should not be parsed to any other type. 只读。Read-only.
namename stringstring 表的名称。Name of the table.
showHeadersshowHeaders booleanboolean 指示标头行是否可见。该值可以设置为显示或删除标头行。Indicates whether the header row is visible or not. This value can be set to show or remove the header row.
showTotalsshowTotals booleanboolean 指示总计行是否可见。该值可以设置为显示或删除总计行。Indicates whether the total row is visible or not. This value can be set to show or remove the total row.
stylestyle stringstring 表示表格样式的常量值。Constant value that represents the Table style. 可取值为:TableStyleLight1 到 TableStyleLight21、TableStyleMedium1 到 TableStyleMedium28、TableStyleStyleDark1 到 TableStyleStyleDark11。The possible values are: TableStyleLight1 thru TableStyleLight21, TableStyleMedium1 thru TableStyleMedium28, TableStyleStyleDark1 thru TableStyleStyleDark11. 还可以指定工作簿中显示的用户定义的自定义样式。A custom user-defined style present in the workbook can also be specified.
highlightFirstColumnhighlightFirstColumn BooleanBoolean 指明第一列是否包含特殊格式。Indicates whether the first column contains special formatting.
highlightLastColumnhighlightLastColumn BooleanBoolean 指明最后一列是否包含特殊格式。Indicates whether the last column contains special formatting.
showBandedColumnsshowBandedColumns BooleanBoolean 指明列是否采用镶边格式来以不同的方式突出显示奇数列与偶数列,让表更易于阅读。Indicates whether the columns show banded formatting in which odd columns are highlighted differently from even ones to make reading the table easier.
showBandedRowsshowBandedRows BooleanBoolean 指明行是否采用镶边格式来以不同的方式突出显示奇数行与偶数行,让表更易于阅读。Indicates whether the rows show banded formatting in which odd rows are highlighted differently from even ones to make reading the table easier.
showFilterButtonshowFilterButton BooleanBoolean 指明是否在每个列标题的顶部显示筛选器按钮。仅当 table 中包含标题行时,才允许设定此设置。Indicates whether the filter buttons are visible at the top of each column header. Setting this is only allowed if the table contains a header row.
legacyIdlegacyId StringString 旧版 Excel 客户端中使用的旧 ID。Legacy Id used in older Excle clients. 即使表格已重命名,标识符值也仍保持不变。The value of the identifier remains the same even when the table is renamed. 应将此属性解析为不透明的字符串值,不得将它解析为其他任何类型。This property should be interpreted as an opaque string value and should not be parsed to any other type. 只读。Read-only.

关系Relationships

关系Relationship 类型Type 说明Description
columnscolumns WorkbookTableColumn 集合WorkbookTableColumn collection 表示表中所有列的集合。只读。Represents a collection of all the columns in the table. Read-only.
rowsrows WorkbookTableRow 集合WorkbookTableRow collection 表示表中所有行的集合。只读。Represents a collection of all the rows in the table. Read-only.
sortsort WorkbookTableSortWorkbookTableSort 表示表的排序。只读。Represents the sorting for the table. Read-only.
worksheetworksheet WorkbookWorksheetWorkbookWorksheet 包含当前表的工作表。只读。The worksheet containing the current table. Read-only.

JSON 表示形式JSON representation

下面是资源的 JSON 表示形式。Here is a JSON representation of the resource.

{
  "highlightFirstColumn": true,
  "highlightLastColumn": true,
  "id": "String (identifier)",
  "name": "String",
  "showBandedColumns": true,
  "showBandedRows": true,
  "showFilterButton": true,
  "showHeaders": true,
  "showTotals": true,
  "style": "String",
  "legacyId": "String"
}