Export (0) Print
Expand All

DefaultTableStyle class

Default Table Style for Newly Inserted Tables. When the object is serialized out as xml, its qualified name is w:defaultTableStyle.

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

public class DefaultTableStyle : String253Type

[ISO/IEC 29500-1 1st Edition]

defaultTableStyle (Default Table Style for Newly Inserted Tables)

This element specifies the table style which shall automatically be applied to the table properties of tables added to this document by an application. Note that it does not change the table style applied to tables which do not reference a style, instead, it automatically applies the style to that table via the tblStyle element (§17.4.63). This link is made by referencing the styleId attribute value of the table style which shall be used to format newly inserted tables.

If this element is omitted, then no table style shall automatically be applied to inserted tables (therefore inheriting the default table style). If the referenced style is not present or not a table style, then no table style shall automatically be applied to inserted tables.

[Example: Consider a WordprocessingML document which should use the LightShading-Accent3 style. This requirement is specified using the following WordprocessingML in the document settings:

<w:defaultTableStyle w:val="LightShading-Accent3" />

The corresponding table style must therefore exist in the styles part:

<w:style w:type="table" w:styleId="LightShading-Accent3">
  …</w:style>

The defaultTableStyle element's val attribute has a value of LightShading-Accent3 specifying that that style is applied automatically to newly inserted tables. end example]

Parent Elements

settings (§17.15.1.78)

Attributes

Description

val (String Value)

Specifies that its contents contain a string.

The contents of this string are interpreted based on the context of the parent XML element.

[Example: Consider the following WordprocessingML fragment:

<w:pPr>
  <w:pStyle w:val="heading1" /> 
</w:pPr>

The value of the val attribute is the ID of the associated paragraph style's styleId.

However, consider the following fragment:

<w:sdtPr>
  <w:alias w:val="SDT Title Example" />
  …
</w:sdtPr>

In this case, the decimal number in the val attribute is the caption of the parent structured document tag. In each case, the value is interpreted in the context of the parent element. end example]

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

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

© ISO/IEC29500: 2008.

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

Community Additions

Show:
© 2014 Microsoft