Tecnologías XML / XSL-FO / Referencia / Atributos de XSL-FO / table-layout

(Extracto de «XSL-FO ― Die Referenz» de Manuel Montero Pineda & Steffen Herkert, 2016, dpunkt.verlag)

Sección de la recomendación: 7.28.16

Categoría: 7.28 Propiedades de tablas

Descripción

Para una tabla (<fo:table>), este atributo activa o desactiva el ajuste automático de la anchura de las columnas. Está activado de forma predeterminada, por lo que la anchura depende del contenido. Si se desactiva, las anchuras se uniformizan y se maximiza la anchura de la tabla. Esta función solo se aplica a las columnas sin anchura fija definida mediante column-width.

Valores

auto

La anchura de las columnas se determina según su contenido.

fixed

La anchura de las columnas se uniformiza con independencia de su contenido.

Heredado:

sí

Valor predeterminado: auto

Versión de XSL-FO: 1.0

Permitido en:

<fo:table>

Este elemento crea una tabla.

Compatibilidad:

Nivel de conformidad

Antenna House

FOP

RenderX XEP

Altsoft XML2PDF

Compart DocBridge

Ampliado

S

N

S

S

S

Ejemplo de XSL-FO:

<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="5mm 5mm 5mm 5mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Inhalt-Seiten">
<fo:flow flow-name="xsl-region-body">
<fo:table table-layout="fixed">
<fo:table-header background-color="#4F491D">
<fo:table-row>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenkopf Spalte 1
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenkopf
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenkopf
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenkopf letzte Spalte
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-footer background-color="#4F491D">
<fo:table-row>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenfuß Spalte 1 Hallo Welt wie geht es dir?
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenfuß
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenfuß
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenfuß letzte Spalte
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-footer>
<fo:table-body background-color="#F38222">
<fo:table-row>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Zeile 1 Spalte 1
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Zeile 1
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Zeile 1
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Zeile 1 letzte Spalte
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell text-align="center" starts-row="true" border="black solid 1pt">
<fo:block>
Zeile 2 Spalte 1
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Zeile 2
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Zeile 2
</fo:block>
</fo:table-cell>
<fo:table-cell ends-row="true" text-align="center" border="black solid 1pt">
<fo:block>
Zeile 2 letzte Spalte
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:table table-layout="auto">
<fo:table-header background-color="#4F491D">
<fo:table-row>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenkopf Spalte 1
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenkopf
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenkopf
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenkopf letzte Spalte
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-footer background-color="#4F491D">
<fo:table-row>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenfuß Spalte 1 Hallo Welt wie geht es dir
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenfuß
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenfuß
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Tabellenfuß letzte Spalte
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-footer>
<fo:table-body background-color="#F38222">
<fo:table-row>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Zeile 1 Spalte 1
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Zeile 1
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Zeile 1
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Zeile 1 letzte Spalte
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell text-align="center" starts-row="true" border="black solid 1pt">
<fo:block>
Zeile 2 Spalte 1
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Zeile 2
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center" border="black solid 1pt">
<fo:block>
Zeile 2
</fo:block>
</fo:table-cell>
<fo:table-cell ends-row="true" text-align="center" border="black solid 1pt">
<fo:block>
Zeile 2 letzte Spalte
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>

Descargar los ejemplos

En la salida:

Extracto de la recomendación del W3C:

Más información en línea sobre

Descripción de la propiedad en la referencia CSS «table-layout»

Representación de la propiedad en la referencia de XSL-FO

volver arriba