DocumentID: ECMA-376/Part4/2.4.68 Title: ECMA-376, Part4: 2.4.68 tcW (Preferred Table Cell Width) Extracted-From: ECMA-376 Office Open XML File Formats, 1st Edition / December 2006 Warning: Coverted to HTML format by a script known to have bugs
This element specifies the preferred width for this table cell. This preferred width is used as part of the table layout algorithm specified by the tblLayout element (§2.4.49; §2.4.50) - full description of the algorithm in the ST_TblLayout simple type (§2.18.94).
All widths in a table are considered preferred because:
This value is specified in the units applied via its type attribute. Any width value of type pct for this element shall be calculated relative to the overall width of the table.
If this element is omitted, then the cell width shall be of type auto.
[Example: Consider a WordprocessingML table defined as follows:
<w:tbl>
<w:tr>
<w:tc>
<w:tcPr>
<w:tcW w:type="pct" w:w="1667"/>
</w:tcPr>
...
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:type="pct" w:w="1667"/>
</w:tcPr>
...
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:type="pct" w:w="1667"/>
</w:tcPr>
...
</w:tc>
</w:tr>
</w:tbl>
This table specifies that it has no preferred table width, but each cell shall be exactly 33.3 percent (1667 fiftieths of a percent) of the overall table width. The resulting table would therefore be sized such that all columns are of the width of the maximum column, as follows:
|
Hello world |
|---|
The text Hello world makes the middle cell larger, and the other two cells are increased in size to maintain the preferred widths of one-third of the overall table width. However, when the middle table cell requires a larger size to accommodate non-breaking text, that preference may be overridden as needed:
|
Hello worlddddddddddddddddddddddddddddddddddd |
||
|---|---|---|
In this case, the middle cell's long non breaking string caused the table to reach the text margins on the page, and therefore to override the preferred widths on the empty cells. end example]
|
Parent Elements |
|
tcPr (§2.7.5.8); tcPr (§2.4.66); tcPr (§2.7.5.9); tcPr (§2.4.67) |
|
Attributes |
Description |
|---|---|
|
type (Table Width Type) |
Specifies the units of the width property being defined by the parent element's If this attribute is omitted, then its value shall be assumed to be dxa (twentieths of a point). [Example: Consider a table with a table cell bottom cell spacing with a
This The possible values for this attribute are defined by the ST_TblWidth simple type (§2.18.97). |
|
w (Table Width Value) |
Specifies the value of the width property being defined by the parent element. This property is used to define various properties of a table, including: cell spacing, preferred widths, and table margins. If this attribute is omitted, then its value shall be assumed to be 0. [Example: Consider a table with a bottom margin with a width of 302, as follows:
The value in the The possible values for this attribute are defined by the ST_DecimalNumber simple type (§2.18.16). |
The following XML Schema fragment defines the contents of this element:
<complexType name="CT_TblWidth">
<attribute name="w" type="ST_DecimalNumber"/>
<attribute name="type" type="ST_TblWidth"/>
</complexType>