Technologies XML / XSL-FO / Référence / Extensions XSL d’Antenna House Formatter / Propriétés / text-align-string
(Extrait 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
Catégorie Espacement et alignement >> Alignement du texte
axf:text-align-string définit l’alignement du texte lorsque text-align="<string>".
Valeur : | |
Valeur initiale : | end |
S’applique à : | |
Hérité : | yes |
Pourcentages : | N/A |
Les valeurs ont les significations suivantes.
start | Identique à text-align ou text-align-last. |
center | Identique à text-align ou text-align-last. |
end | Identique à text-align ou text-align-last. |
inside | Identique à text-align ou text-align-last. |
outside | Identique à text-align ou text-align-last. |
left | Identique à text-align ou text-align-last. |
right | Identique à text-align ou text-align-last. |
Bien que la spécification de <string> pour fo:table-cell aligne la position du caractère de séparation décimale, par exemple, aucun alignement n’est défini pour la chaîne entière. Par défaut, AH Formatter V6.3 l’affichait alignée à droite conformément à l’illustration de 17.5.4 Alignement horizontal dans une colonne. AH Formatter V6.3 étend ce réglage et permet un alignement à gauche ou centré
Exemple 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>Résultat :