Tecnologías XML / XSL-FO / Referencia / Extensiones XSL de Antenna House Formatter / Propiedades / text-align-string

(Extracto de «XSL-FO ― Die Referenz» de 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

Categoría Espaciado y alineación >> Alineación del texto

axf:text-align-string especifica la alineación del texto cuando text-align="<string>".

Valor:

start | center | end | inside | outside | left | right

Valor inicial:

end

Se aplica a:

fo:block

Heredado:

yes

Porcentajes:

N/A

Los valores tienen los significados siguientes.

start

Igual que text-align o text-align-last.

center

Igual que text-align o text-align-last.

end

Igual que text-align o text-align-last.

inside

Igual que text-align o text-align-last.

outside

Igual que text-align o text-align-last.

left

Igual que text-align o text-align-last.

right

Igual que text-align o text-align-last.

Aunque especificar <string> en fo:table-cell alinea la posición del carácter de separación decimal, por ejemplo, no se define la alineación de toda la cadena. De forma predeterminada, AH Formatter V6.3 la mostraba alineada a la derecha según la ilustración de 17.5.4 Alineación horizontal en una columna. AH Formatter V6.3 amplía este ajuste y permite alinearla a la izquierda o centrarla

Ejemplo XSL-FO:

<fo:root xml:lang="en" 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">
<axf:document-info name="document-title" value="Text alignment by text-align="<string>""/>
<axf:document-info name="author" value="Antenna House, Inc."/>
<fo:layout-master-set>
<fo:simple-page-master page-height="297mm" page-width="210mm" margin-top="10mm" margin-left="20mm" margin-right="20mm" margin-bottom="10mm" master-name="PageMaster1">
<fo:region-after extent="7mm"/>
<fo:region-body margin-top="0mm" margin-left="0mm" margin-right="0mm" margin-bottom="10mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="PageMaster1">
<fo:static-content flow-name="xsl-region-after">
<fo:block font-size="0.8em" text-align="right" color="green">
<fo:basic-link external-destination="http://www.antennahouse.com/">
Antenna House, Inc.
</fo:basic-link>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body" font-family="serif" font-size="1em" line-height="1.4" axf:hyphenate-hyphenated-word="false" hyphenate="true">
<fo:block span="all" font-family="sans-serif" font-size="2em" font-weight="bold" line-height="2" space-before="1em" space-after="1em" space-before.conditionality="retain" space-after.conditionality="retain" background-color="#EEEEEE">
<fo:block start-indent="1em" end-indent="1em">
Text alignment by text-align="<string>" 
</fo:block>
</fo:block>
<fo:block span="all" space-before="1em" space-after="1em" space-after.conditionality="retain" text-indent="0em" border="1pt solid #9999FF" start-indent="0.5em" end-indent="0.5em" padding="0.5em" text-align="justify">

Specifying <string> to fo:table-cell aligns the position of specified letters such as a decimal point, however there is no regulation if a whole character string should be aligned on one side or the other. As a default setting, by following the illustration of CSS2 17.5.4 Horizontal alignment in a column, AH Formatter displays text in right-aligned. AH Formatter enables left-aligned and centered by extending this feataure.

</fo:block>
<fo:block space-before="1em" font-family="sans-serif" font-size="1.2em" font-weight="bold" text-indent="0em" line-height="2" keep-with-next.within-column="always">
No setting of text-align / axf:text-align-string
</fo:block>
<fo:table table-layout="fixed">
<fo:table-column column-width="auto"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
ABC
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
0.0
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
AAA.BBB
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100000000
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
0.0001
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
AAA.BBBCCCC
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100000000.12345
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
9990.0001
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:block space-before="1em" font-family="sans-serif" font-size="1.2em" font-weight="bold" text-indent="0em" line-height="2" keep-with-next.within-column="always">
text-align="'.'" No setting of axf:text-align-string
</fo:block>
<fo:table table-layout="fixed" text-align="'.'">
<fo:table-column column-width="auto"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
ABC
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
0.0
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
AAA.BBB
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100000000
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
0.0001
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
AAA.BBBCCCC
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100000000.12345
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
9990.0001
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:block space-before="1em" font-family="sans-serif" font-size="1.2em" font-weight="bold" text-indent="0em" line-height="2" keep-with-next.within-column="always">
text-align="'.'" axf:text-align-string="start"
</fo:block>
<fo:table table-layout="fixed" text-align="'.'" axf:text-align-string="start">
<fo:table-column column-width="auto"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
ABC
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
0.0
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
AAA.BBB
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100000000
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
0.0001
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
AAA.BBBCCCC
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100000000.12345
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
9990.0001
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:block space-before="1em" font-family="sans-serif" font-size="1.2em" font-weight="bold" text-indent="0em" line-height="2" keep-with-next.within-column="always">
text-align="'.'" axf:text-align-string="center"
</fo:block>
<fo:table table-layout="fixed" text-align="'.'" axf:text-align-string="center">
<fo:table-column column-width="auto"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
ABC
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
0.0
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
AAA.BBB
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100000000
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
0.0001
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
AAA.BBBCCCC
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100000000.12345
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
9990.0001
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:block space-before="1em" font-family="sans-serif" font-size="1.2em" font-weight="bold" text-indent="0em" line-height="2" keep-with-next.within-column="always">
text-align="'.'" axf:text-align-string="end"
</fo:block>
<fo:table table-layout="fixed" text-align="'.'" axf:text-align-string="end">
<fo:table-column column-width="auto"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
ABC
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
0.0
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
AAA.BBB
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100000000
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
0.0001
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
AAA.BBBCCCC
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100000000.12345
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
9990.0001
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
<fo:block space-before="1em" font-family="sans-serif" font-size="1.2em" font-weight="bold" text-indent="0em" line-height="2" keep-with-next.within-column="always">
text-align="'.'" axf:text-align-string="inside"
</fo:block>
<fo:table table-layout="fixed" text-align="'.'" axf:text-align-string="inside">
<fo:table-column column-width="auto"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
ABC
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
0.0
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
AAA.BBB
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100000000
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
0.0001
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid">
<fo:block>
AAA.BBBCCCC
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
100000000.12345
</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid">
<fo:block>
9990.0001
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>

Descargar los ejemplos

Resultado:

volver arriba