XML technologies / XSL-FO / Reference / Attributes in XSL-FO / column-width

(Excerpt from "XSL-FO ― Die Referenz" by Manuel Montero Pineda & Steffen Herkert, 2016, dpunkt.verlag)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

Recommendation section: 7.28.9

Category: 7.28 Table Properties

Description

This attribute sets the width of table columns (<fo:table-cell>). The value can be relative to the total table width, relative to other columns, or an absolute measurement (length).

Values

percentage

The column width can be specified relative to the total table width by a number (possibly negative or decimal) followed by the percent sign (%).

length

The column width can be specified using an absolute measurement. The value must be a number (possibly negative or decimal) followed by a unit (em, ex, px, pt, in, cm, mm, pc).

Function value

The proportional-column-width() function sets column widths relative to one another. The W3C Recommendation requires the table (<fo:table>) to use a fixed layout (table-layout="fixed") for this function.

XSL-FO version: 1.0

Allowed in:

<fo:table-column>

This element specifies properties for table cells in the same column.

Support:

Conformance level

Antenna House

FOP

RenderX XEP

Altsoft XML2PDF

Compart DocBridge

Basic

Y

Y

Y

Y

Y

XSL-FO example:

<fo:root font-family="Arial" font-size="10pt" line-height="1.2em" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:cpfo="http://www.compart.net/xmlns/cpfo" xmlns:svg="http://www.w3.org/2000/svg" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
<fo:layout-master-set>
<fo:simple-page-master master-name="Inhalt-Seiten" margin="0mm 0mm 0mm
                      0mm" page-height="297mm" page-width="210mm">
<fo:region-body margin="26mm 55mm 41mm
                        55mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Inhalt-Seiten">
<fo:flow flow-name="xsl-region-body">
<fo:table-and-caption>
<fo:table>
<fo:table-column column-width="40mm" border-style="solid"/>
<fo:table-column column-width="25mm" border-style="dotted"/>
<fo:table-header text-align="center" border-style="solid">
<fo:table-cell>
<fo:block font-weight="bold">
Auto
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-weight="bold">
Preis
</fo:block>
</fo:table-cell>
</fo:table-header>
<fo:table-body text-align="center">
<fo:table-row>
<fo:table-cell border-style="dotted" border-width="1mm">
<fo:block>
Audi
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
777
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:block>
Mercedes
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
777
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-and-caption>
</fo:flow>
</fo:page-sequence>
</fo:root>

Download the examples

In the output:

Excerpt from the W3C Recommendation:

More information online about

Introduction: "Tables">

Rendering of the property in the XSL-FO reference

back to top