XML technologies / DocBook / Block elements / Tables / Adjusting column widths

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

Column width is controlled by the element colspec. The attribute for this is colwidth; it accepts a fixed value, a proportional value or both. Available units are listed in the following table.

Table: Units of measurement

Abbreviation

Meaning

cm

Centimeters

em

Width of the letter "M" in the current character set ("Ems")

in

Inch (1 in = 2,54 cm)

pc

Pica (1/16 in = 0,158750 cm)

pt

Points (1/72 in = 0,03528 cm)

px

Pixels

Example: Different column widths in a CALS table

<tgroup cols="3">
     <colspec colwidth="4cm"/>
     <colspec colwidth="2*"/>
     <colspec colwidth="1*"/>
</tgroup>

In the listing above, the first column has a fixed width of 4 cm, while the second is twice as wide as the third. Extensions calculate the absolute column widths; see “Extension functions and extension elements”.

  

back to top