J.4.5 Understanding the Organization of a Table via Table Headings
Tables are an often-seen element of many documents. As tables become more complex, with multi- level headers, they can become unreadable to certain customers if multi-level headings are not supported in the document. Fortunately, Office Open XML does support multi-level headings.
Consider the following table:
(H1) Married filing jointly and you have -
(H2) No Children
(H3) One Child
(H4) Two Children
(H5) Your Credit Is-
$100
$200
$400
The mark-up for such a table would be as follows:
…
<w:tr> <w:tc w:id= “H1”> <w:tcPr> <w:colSpan w:val=“3”/> </w:tcPr>
<w:p>
<w:r> <w:t>Married filing jointly and you have -</w:t> </w:r> </w:p> </w:tc> </w:tr>
<w:tr> <w:tc w:id= “H2”> <w:tcPr> <w:headers> <w:header w:val=“H1”/> </w:headers> </w:tcPr>
<w:p>
<w:r> <w:t>No Children</w:t> </w:r> </w:p> </w:tc>
<w:tc w:id= “H3”> <w:tcPr> <w:headers> <w:header w:val=“H1”/> </w:headers> </w:tcPr>
<w:p>
<w:r> <w:t>One Child</w:t> </w:r> </w:p> </w:tc>
<w:tc w:id= “H4”> <w:tcPr> <w:headers> <w:header w:val=“H1”/> </w:headers> </w:tcPr>
<w:p>
<w:r> <w:t>Two Children</w:t> </w:r> </w:p> </w:tc> </w:tr>
<w:tr> <w:tc w:id= “H5”> <w:tcPr> <w:colSpan w:val=“3”/> </w:tcPr>
<w:p>
<w:r> <w:t>Married filing jointly and you have -</w:t> </w:r>
</w:p> </w:tc> </w:tr>
<w:tr> <w:tc w:id= “H2”> <w:tcPr> <w:headers> <w:header w:val=“H1”/> <w:header w:val=“H2”/> <w:header w:val=“H5”/> </w:headers> </w:tcPr>
<w:p>
<w:r>
<w:t>$100</w:t> </w:r> </w:p> </w:tc>
<w:tc w:id= “H3”> <w:tcPr> <w:headers> <w:header w:val=“H1”/> <w:header w:val=“H3”/> <w:header w:val=“H5”/> </w:headers> </w:tcPr>
<w:p>
<w:r> <w:t>One Child</w:t> </w:r> </w:p> </w:tc>
<w:tc w:id= “H4”> <w:tcPr> <w:headers> <w:header w:val=“H1”/> <w:header w:val=“H4”/> <w:header w:val=“H5”/> </w:headers>
</w:tcPr>
<w:p>
<w:r> <w:t>Two Children</w:t> </w:r> </w:p> </w:tc> </w:tr>
The cell with $200 declares three headers:
H1 – Married filing jointly and you have -
H3 – One Child
H5 – Your Credit Is-