Table Style

The complex type, CT_TableStyle, defines the actual table style. There are thirteen different parts (outside of the table background) that can be defined in a table style. These parts work together to define the styling for a table, given the six combinations of on/off states for the first row, first column, last row, last column, row banding, and column banding options. The different parts of a table that make up a table style are:

  • tableBg – table background (this is not a CT_TablePartStyle)

  • wholeTable – formatting for the entire table

  • band1Horizontal – applied when row banding is enabled, this is the first row style, which alternates with band2Horiztonal

  • band2Horizontal – applied when row banding is enabled, this is the second row style, which alternates with band1Horizontal

  • band1Vertical – applied when column banding is enabled, this is the first column style, which alternates with band2Vertial

  • band2Vertical – applied when column banding is enabled, this is the second column style, which alternates with band1Vertical

  • lastCol – formatting applied to the last column when last column formatting is enabled

  • firstCol – formatting applied to the first column when first column formatting is enabled

  • lastRow – formatting applied to the last row when last row formatting is enabled

  • firstRow – formatting applied to the first row when first row formatting is enabled

  • seCell – formatting applied to the cell in the southeast corner of the table when last column and last row are enabled

  • swCell – formatting applied to the cell in the southwest corner of the table when first column and last row are enabled

  • neCell – formatting applied to the cell in the northeast corner of the table when the last column and first row are enabled

  • nwCell – formatting applied to the cell in the northwest corner of the table when the first column and first row are enabled

The table style is defined in the following manner:

<xsd:complexType name="CT_TableStyle">
  <xsd:sequence>
    <xsd:element name="tblBg" type="CT_TableBackgroundStyle" 
      minOccurs="0" maxOccurs="1" />
    <xsd:element name="wholeTbl" type="CT_TablePartStyle" 
      minOccurs="0" maxOccurs="1" />
    <xsd:element name="band1H" type="CT_TablePartStyle" minOccurs="0" 
      maxOccurs="1" />
    <xsd:element name="band2H" type="CT_TablePartStyle" minOccurs="0" 
      maxOccurs="1" />
    <xsd:element name="band1V" type="CT_TablePartStyle" minOccurs="0" 
      maxOccurs="1" />
    <xsd:element name="band2V" type="CT_TablePartStyle" minOccurs="0" 
      maxOccurs="1" />
    <xsd:element name="lastCol" type="CT_TablePartStyle" 
      minOccurs="0" maxOccurs="1" />
    <xsd:element name="firstCol" type="CT_TablePartStyle" 
      minOccurs="0" maxOccurs="1" />
    <xsd:element name="lastRow" type="CT_TablePartStyle" 
      minOccurs="0" maxOccurs="1" />
    <xsd:element name="seCell" type="CT_TablePartStyle" minOccurs="0" 
      maxOccurs="1" />
    <xsd:element name="swCell" type="CT_TablePartStyle" minOccurs="0" 
      maxOccurs="1" />
    <xsd:element name="firstRow" type="CT_TablePartStyle" 
      minOccurs="0" maxOccurs="1" />
    <xsd:element name="neCell" type="CT_TablePartStyle" minOccurs="0" 
      maxOccurs="1" />
    <xsd:element name="nwCell" type="CT_TablePartStyle" minOccurs="0" 
      maxOccurs="1" />
    <xsd:element name="extLst" type="CT_OfficeArtExtensionList" 
      minOccurs="0" maxOccurs="1" />
  </xsd:sequence>
  <xsd:attribute name="styleId" type="ST_Guid" use="required" />
  <xsd:attribute name="styleName" type="xsd:string" use="required" />
</xsd:complexType>

Also contained within the table style is an ID and a name. The name shows up as the name for the table style and the ID is the unique id (GUID) that is associated with the table style.