TableCell class
Table Cell. When the object is serialized out as xml, its qualified name is w:tc.
DocumentFormat.OpenXml.OpenXmlElement
DocumentFormat.OpenXml.OpenXmlCompositeElement
DocumentFormat.OpenXml.Wordprocessing.TableCell
Namespace: DocumentFormat.OpenXml.Wordprocessing
Assembly: DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)
[ISO/IEC 29500-1 1st Edition]
tc (Table Cell)
This element specifies a single cell in a table row, which contains the table’s content. Table cells in WordprocessingML are analogous to HTML td elements.
A tc element has one formatting child element, tcPr (§17.4.70), which defines the properties for the cell. Each unique property on the table cell is specified by a child element of this element. As well, a table cell can contain any block-level content, which allows for the nesting of paragraphs and tables within table cells.
If a table cell does not include at least one block-level element, then this document shall be considered corrupt.
[Example: Consider a table consisting of a single table cell, which contains the text Hello World:
Hello World
This table cell's content is represented by the following WordprocessingML:
<w:tc>
<w:tcPr>
<w:tcW w:w="0" w:type="auto"/>
</w:tcPr>
<w:p>
<w:r>
<w:t>Hello, World</w:t>
</w:r>
</w:p>
</w:tc>The tc element contains a set of cell-level properties defined using the tcPr element, and a single block-level element - in this case, a paragraph. end example]
Parent Elements |
|---|
customXml (§17.5.1.4); sdtContent (§17.5.2.33); tr (§17.4.79) |
Child Elements | Subclause |
|---|---|
altChunk (Anchor for Imported External Content) | §17.17.2.1 |
bookmarkEnd (Bookmark End) | §17.13.6.1 |
bookmarkStart (Bookmark Start) | §17.13.6.2 |
commentRangeEnd (Comment Anchor Range End) | §17.13.4.3 |
commentRangeStart (Comment Anchor Range Start) | §17.13.4.4 |
customXml (Block-Level Custom XML Element) | §17.5.1.6 |
customXmlDelRangeEnd (Custom XML Markup Deletion End) | §17.13.5.4 |
customXmlDelRangeStart (Custom XML Markup Deletion Start) | §17.13.5.5 |
customXmlInsRangeEnd (Custom XML Markup Insertion End) | §17.13.5.6 |
customXmlInsRangeStart (Custom XML Markup Insertion Start) | §17.13.5.7 |
customXmlMoveFromRangeEnd (Custom XML Markup Move Source End) | §17.13.5.8 |
customXmlMoveFromRangeStart (Custom XML Markup Move Source Start) | §17.13.5.9 |
customXmlMoveToRangeEnd (Custom XML Markup Move Destination Location End) | §17.13.5.10 |
customXmlMoveToRangeStart (Custom XML Markup Move Destination Location Start) | §17.13.5.11 |
del (Deleted Run Content) | §17.13.5.14 |
ins (Inserted Run Content) | §17.13.5.18 |
moveFrom (Move Source Run Content) | §17.13.5.22 |
moveFromRangeEnd (Move Source Location Container - End) | §17.13.5.23 |
moveFromRangeStart (Move Source Location Container - Start) | §17.13.5.24 |
moveTo (Move Destination Run Content) | §17.13.5.25 |
moveToRangeEnd (Move Destination Location Container - End) | §17.13.5.27 |
moveToRangeStart (Move Destination Location Container - Start) | §17.13.5.28 |
oMath (Office Math) | §22.1.2.77 |
oMathPara (Office Math Paragraph) | §22.1.2.78 |
p (Paragraph) | §17.3.1.22 |
permEnd (Range Permission End) | §17.13.7.1 |
permStart (Range Permission Start) | §17.13.7.2 |
proofErr (Proofing Error Anchor) | §17.13.8.1 |
sdt (Block-Level Structured Document Tag) | §17.5.2.29 |
tbl (Table) | §17.4.38 |
tcPr (Table Cell Properties) | §17.4.70 |
Attributes | Description |
|---|---|
id (Table Cell Identifier) | Specifies a unique identifier for the current table cell. This identifier shall be unique within the table, and is used to identify this table cell as a header cell for other cells within the table, using the headers child element. If this element is omitted, this table cell has no unique identifier. [Example: Consider a table cell defined as follows: <w:tc w:id="januaryeight"> …</w:tc> The value in the id specifies a unique identifer of januaryeight. Other cells in the table are then able to reference this cell as a row or column header by referencing this ID. 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_Tc) is located in §A.1. end note]
© ISO/IEC29500: 2008.