17.4 Tables

Another form 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

tag. The table element specifies the location of a table present in the document.

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

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

[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:start 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:end 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]

Subsections

Last updated on