table, tableHeader, row, entry

Sandcastle MAML

Sandcastle MAML Guide table, tableHeader, row, entry

This element is used to arrange data in a table format with rows and columns. An optional title and table header can also be included.

Usage

A table consists of the following elements:

table

This is the main element. All other table elements are nested within it and it has no attributes.

title

This is an optional element. If specified, it defines a title that will appear above the table.

tableHeader

This is an optional element. If specified, it should contain a single row element that defines the header row. This can be used to add titles to each column. The table header, if specified, will be styled differently in the rendered topic.

row

This element is used to define each row in the table. A table must contain at least one row. Each row must contain one or more entry elements that define the columns in the row.

entry

This element is used to define the columns in each row. The entry items can themselves contain other MAML elements, nested lists, tables, etc. Text should be contained in a para element.

Tip Tip

The entry element supports an address attribute that can be used to link to a specific entry from another location.

Tip Tip

To render an empty cell, use a non-breaking space entity ( ).

Note Note

There are no provisions for spanning rows or columns as there is in HTML tables. As such, each row must contain the same number of columns. However, you can nest tables within an entry element which can be used to achieve a similar effect.

Example
<para>This link takes you to <link xlink:href="#Row3Cell1">Row 3, Cell 1</link>
in the first table.</para>

<table>
  <title>A Simple Table with Title and Headers</title>
  <tableHeader>
    <row>
      <entry><para>Header 1</para></entry>
      <entry><para>Header 2</para></entry>
      <entry><para>Header 3</para></entry>
    </row>
  </tableHeader>
  <row>
      <entry><para>Row 1, Cell 1</para></entry>
      <entry><para>Row 1, Cell 2</para></entry>
      <entry><para>Row 1, Cell 3</para></entry>
  </row>
  <row>
      <entry><para>Row 2, Cell 1</para></entry>
      <entry><para>Row 2, Cell 2</para></entry>
      <entry><para>Row 2, Cell 3</para></entry>
  </row>
  <row>
      <entry address="Row3Cell1"><para>This entry has an <codeInline>address</codeInline>
attribute that can be used as a link target.</para></entry>
      <entry><para>Row 3, Cell 2</para></entry>
      <entry><para>Row 3, Cell 3</para></entry>
  </row>
</table>

<table>
  <tableHeader>
    <row>
    <entry><para>&#160;</para></entry>
    <entry><para>A Nested Table Example</para></entry>
    </row>
  </tableHeader>
  <row>
    <entry><mediaLink><image
       xlink:href="98a8a8b7-c374-40c7-902a-91c947bf107c"/>
       </mediaLink></entry>
    <entry>
    <table>
      <row>
        <entry><para>Cell 1</para></entry>
        <entry><para>Cell 2</para></entry>
        <entry><para>Cell 3</para></entry>
        <entry><para>Cell 4</para></entry>
      </row>
      <row>
        <entry><para>Cell 5</para></entry>
        <entry><para>Cell 6</para></entry>
        <entry><para>Cell 7</para></entry>
        <entry><para>Cell 8</para></entry>
      </row>
      <row>
        <entry><para>Cell 9</para></entry>
        <entry><para>Cell 10</para></entry>
        <entry><para>Cell 11</para></entry>
        <entry><para>Cell 12</para></entry>
      </row>
    </table>

    <para>The table above doesn't have a
<codeInline>tableHeader</codeInline>.</para>
    </entry>
  </row>
</table>
Example Output

This link takes you to Row 3, Cell 1 in the first table.

A Simple Table with Title and Headers

Header 1

Header 2

Header 3

Row 1, Cell 1

Row 1, Cell 2

Row 1, Cell 3

Row 2, Cell 1

Row 2, Cell 2

Row 2, Cell 3

This entry has an address attribute that can be used as a link target.

Row 3, Cell 2

Row 3, Cell 3

 

A Nested Table Example

Cell 1

Cell 2

Cell 3

Cell 4

Cell 5

Cell 6

Cell 7

Cell 8

Cell 9

Cell 10

Cell 11

Cell 12

The table above doesn't have a tableHeader.

See Also