[Table of Contents] [docx version]

WordprocessingML Reference Material - Table of Contents

Tables

Another type of block-level content in WordprocessingML, a table is a set of paragraphs (and other block-level content) arranged in rows and columns. Tables in WordprocessingML are defined via the tbl element, which is analogous to the HTML <table> tag. The table element specifies the location of a table present in the document.

A tbl element (§2.4.36) has two elements that define its properties:

tblPr (§2.4.55), which defines the set of table-wide properties (such as style and width)

tblGrid (§2.4.44), which defines the grid layout of the table.

A tbl element can also contain an arbitrary non-zero number of rows, where each row is specified with a tr element (§2.4.75). Each tr element can contain an arbitrary non-zero number of cells, where each cell is specified with a tc element (§2.4.62).

[Example: Consider an empty one-cell table (i.e.; a table with one row, one column) and 1 point borders on all sides as follows:

 

 

This table is represented by the following WordprocessingML:

<w:tbl>
<w:tblPr>
<w:tblW w:w="5000" w:type="pct"/>
<w:tblBorders>
<w:top w:val="single" w:sz="4" w:space="0" w:color="auto"/>
<w:left w:val="single" w:sz="4 w:space="0" w:color="auto"/>
<w:bottom w:val="single" w:sz="4" w:space="0" w:color="auto"/>
<w:right w:val="single" w:sz="4" w:space="0" w:color="auto"/>
</w:tblBorders>
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="10296"/>
</w:tblGrid>
<w:tr>
<w:tc>
<w:tcPr>
<w:tcW w:w="0" w:type="auto"/>
</w:tcPr>
<w:p/>
</w:tc>
</w:tr>
</w:tbl>

This table specifies table-wide properties of 100% of page width using the tblW element and the set of table borders using the tblBorders element, the table grid which defines a set of shared vertical edges within the table using the tblGrid element, and a single row using the tr element. end example]