Поделиться через


Table Class

Table. It is the root element of TableDefinitionPart.When the object is serialized out as xml, its qualified name is x:table.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.OpenXmlPartRootElement
        DocumentFormat.OpenXml.Spreadsheet.Table

Namespace:  DocumentFormat.OpenXml.Spreadsheet
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(TableExtensionList))> _
<ChildElementInfoAttribute(GetType(SortState))> _
<ChildElementInfoAttribute(GetType(TableColumns))> _
<ChildElementInfoAttribute(GetType(AutoFilter))> _
<ChildElementInfoAttribute(GetType(TableStyleInfo))> _
Public Class Table _
    Inherits OpenXmlPartRootElement
'Usage
Dim instance As Table
[ChildElementInfoAttribute(typeof(TableExtensionList))]
[ChildElementInfoAttribute(typeof(SortState))]
[ChildElementInfoAttribute(typeof(TableColumns))]
[ChildElementInfoAttribute(typeof(AutoFilter))]
[ChildElementInfoAttribute(typeof(TableStyleInfo))]
public class Table : OpenXmlPartRootElement

Remarks

The following table lists the possible child types:

  • AutoFilter <x:autoFilter>

  • SortState <x:sortState>

  • TableColumns <x:tableColumns>

  • TableStyleInfo <x:tableStyleInfo>

  • TableExtensionList <x:extLst>

[ISO/IEC 29500-1 1st Edition]

18.5.1.2 table (Table)

This element is the root element for a table that is not a single cell XML table.

Parent Elements

Root element of SpreadsheetML Table Definitions part

Child Elements

Subclause

autoFilter (AutoFilter Settings)

§18.3.1.2

extLst (Future Feature Data Storage Area)

§18.2.10

sortState (Sort State)

§18.3.1.92

tableColumns (Table Columns)

§18.5.1.4

tableStyleInfo (Table Style)

§18.5.1.5

Attributes

Description

comment (Table Comment)

A string representing a textual comment about the table.

[Note: This can be used by the spreadsheet application in other UI. end note] [Example: There can be name UI that is used to organize defined names and function references, if tables are listed in that UI the comment can give more information about the table. end example]

The maximum length of this string should be 32767 characters.

The possible values for this attribute are defined by the ST_Xstring simple type (§22.9.2.19).

connectionId (Connection ID)

An integer representing an ID to indicate which connection from the connections collection is used by this table.

This shall only be used for tables that are based off of xml maps.

The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype.

dataCellStyle (Data Style Name)

A string representing the name of the cell style that is applied to the data area cells of the table.

If this string is missing or does not correspond to the name of a cell style, then the data cell style specified by the current table style should be applied.

The possible values for this attribute are defined by the ST_Xstring simple type (§22.9.2.19).

dataDxfId (Data Area Format Id)

A zero based integer index into the differential formatting records <dxfs> in the styleSheet indicating which format to apply to the data area of this table.

The spreadsheet should fail to load if this index is out of bounds.

The possible values for this attribute are defined by the ST_DxfId simple type (§18.18.25).

displayName (Table Name)

A string representing the name of the table. This is the name that shall be used in formula references, and displayed in the UI to the spreadsheet user.

This name shall not have any spaces in it, and it shall be unique amongst all other displayNames and definedNames in the workbook. The character lengths and restrictions are the same as for definedNames. See SpreadsheetML Reference - Workbook definedNames section for details

The possible values for this attribute are defined by the ST_Xstring simple type (§22.9.2.19).

headerRowBorderDxfId (Header Row Border Format Id)

A zero based integer index into the differential formatting records <dxfs> in the styleSheet indicating what border formatting to apply to the header row of this table.

The spreadsheet should fail to load if this index is out of bounds.

The possible values for this attribute are defined by the ST_DxfId simple type (§18.18.25).

headerRowCellStyle (Header Row Style)

A string representing the name of the cell style that is applied to the header row cells of the table.

If this string is missing or does not correspond to the name of a cell style, then the header row style specified by the current table style should be applied.

The possible values for this attribute are defined by the ST_Xstring simple type (§22.9.2.19).

headerRowCount (Header Row Count)

An integer representing the number of header rows showing at the top of the table. 0 means that the header row is not shown.

It is up to the spreadsheet application to determine if numbers greater than 1 are allowed. Unless the spreadsheet application has a feature where there might ever be more than one header row, this number should not be higher than 1.

The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype.

headerRowDxfId (Header Row Format Id)

A zero based integer index into the differential formatting records <dxfs>in the styleSheet indicating which format to apply to the header row of this table.

The spreadsheet should fail to load if this index is out of bounds.

The possible values for this attribute are defined by the ST_DxfId simple type (§18.18.25).

id (Table Id)

A non zero integer representing the unique identifier for this table. Each table in the workbook shall have a unique id.

Ids can be used to refer to the specific table in the workbook. [Note: For instance a future records bucket could refer to the table using this id. end note]

The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype.

insertRow (Insert Row Showing)

A Boolean value indicating whether the insert row is showing. True when the insert row is showing, false otherwise.

The insert row should only be shown if the table has no data.

When a user clicks the insert row in the UI, it provides them an easy way to enter data into a table.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

insertRowShift (Insert Row Shift)

A Boolean that indicates whether cells in the sheet had to be inserted when the insert row was shown for this table. True if the cells were shifted, false otherwise.

[Note: This happens when there are values in cells immediately below the table when the table is created and the insert row is shown. In this case blank cells for the insert row are inserted, and the existing values in the sheet are shifted down by one row to make room.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

name (Name)

A string representing the name of the table that is used to reference the table programmatically through the spreadsheet applications object model. This string shall be unique per table per sheet. It has the same length and character restrictions as for displayName.

By default this should be the same as the table's displayName. This name should also be kept in synch with the displayName when the displayName is updated in the UI by the spreadsheet user.

The possible values for this attribute are defined by the ST_Xstring simple type (§22.9.2.19).

published (Published)

A Boolean representing whether this table is marked as published for viewing by a server based spreadsheet application. True if it should be viewed by the server spreadsheet application, false otherwise.

[Note: Such an application might only display objects from the workbook that are marked as published, thus being able to load and calculate the entire workbook but only show the specific items that are marked as published. This can allow the server spreadsheet rendering to provide a more restricted view of the workbook. end note]

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

ref (Reference)

The range on the relevant sheet that the table occupies expressed using A1 style referencing.

The reference shall include the totals row if it is shown.

The possible values for this attribute are defined by the ST_Ref simple type (§18.18.62).

tableBorderDxfId (Table Border Format Id)

A zero based integer index into the differential formatting records <dxfs> in the styleSheet indicating what border formatting to apply to the borders of this table.

The spreadsheet should fail to load if this index is out of bounds.

The possible values for this attribute are defined by the ST_DxfId simple type (§18.18.25).

tableType (Table Type)

An optional enumeration specifying the type or source of the table.

Indicates whether the table is based off of an external data query, data in a worksheet, or from an xml data mapped to a worksheet.

The possible values for this attribute are defined by the ST_TableType simple type (§18.18.78).

totalsRowBorderDxfId (Totals Row Border Format Id)

A zero based integer index into the differential formatting records <dxfs> in the styleSheet indicating what border formatting to apply to the totals row of this table.

The spreadsheet should fail to load if this index is out of bounds.

The possible values for this attribute are defined by the ST_DxfId simple type (§18.18.25).

totalsRowCellStyle (Totals Row Style)

A string representing the name of the cell style that is applied to the totals row cells of the table.

If this string is missing or does not correspond to the name of a cell style, then the totals row style specified by the current table style should be applied.

The possible values for this attribute are defined by the ST_Xstring simple type (§22.9.2.19).

totalsRowCount (Totals Row Count)

An integer representing the number of totals rows that shall be shown at the bottom of the table.

0 means that the totals row is not shown. It is up to the spreadsheet application to determine if numbers greater than 1 are allowed. Unless the spreadsheet application has a feature where their might ever be more than one totals row, this number should not be higher than 1.

The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype.

totalsRowDxfId (Totals Row Format Id)

A zero based integer index into the differential formatting records <dxfs> in the styleSheet indicating which format to apply to the totals row of this table.

The spreadsheet should fail to load if this index is out of bounds.

The possible values for this attribute are defined by the ST_DxfId simple type (§18.18.25).

totalsRowShown (Totals Row Shown)

A Boolean indicating whether the totals row has ever been shown in the past for this table. True if the totals row has been shown, false otherwise.

The possible values for this attribute are defined by the W3C XML Schema boolean datatype.

[Note: The W3C XML Schema definition of this element’s content model (CT_Table) is located in §A.2. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Table Members

DocumentFormat.OpenXml.Spreadsheet Namespace