XML technologies / DocBook / Block elements / Tables / Aligning columns

(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)

Column alignment is controlled by the attributes align and valign:

Horizontal (align)

This attribute accepts the values center (centred), left (left-aligned), right (right-aligned) and justify (justified). The value char has a special role: it aligns a column on a character. A typical use is aligning decimal numbers on a point or comma.

The attribute align is available in the following elements: colspec, entry, spanspec and tgroup.

Vertical (valign)

This attribute accepts the values top (top), middle (middle) or bottom (bottom).
The attribute valign is available in the following elements: entry, row, tbody, tfoot and thead.

The following example shows a table using the attribute values described above:

<table>
  <title>...</title>
  <tgroup cols="2">
    <tbody valign="middle">
      <row valign="top">
        <entry align="right">...</entry>
        <entry align="center">...</entry>
      </row>
    </tbody>
  </tgroup>
</table>

  

back to top