如何水平对齐 XSL-FO 中旋转的 table 单元格中的文本?
How to horizontally align text within a rotated table cell in XSL-FO?
对于 Antenna House 5.3,我还没有找到如何创建一个 table 旋转 90 度的单元格 "left aligned"(所以,在页面的底部垂直)和 "vertically centered"(在页面中间水平)。我已经尝试了所有我认为可以的text-align display-align组合,但结果仍然是"top aligned"(垂直底部,水平左侧)。
您知道如何在旋转的 table 单元格中使文本左对齐并垂直居中吗?这是一个单元格的示例:
<fo:table-cell display-align="after">
<fo:block-container reference-orientation="90" display-align="center">
<fo:block>Text</fo:block>
</fo:block-container>
</fo:table-cell>
结果是文本在页面上没有从左到右居中。
使用 AH Formatter V6.6(我没有安装 V5.3),如果你给 table 列一个宽度(使用 fo:column
和 column-width
)并且在 fo:block-container
上设置 height="100%"
,然后格式化程序有更多的工作要做,以便它可以使列中的文本居中。
下面的屏幕截图来自启用了 'Show Border' 选项的 AH Formatter GUI,因此您可以看到区域的范围并看到第二个 fo:block-container
的(旋转)高度table header 单元格。
<fo:table start-indent="0" end-indent="0">
<fo:table-column column-width="50pt" />
<fo:table-column column-width="50pt" />
<fo:table-header>
<fo:table-row>
<fo:table-cell display-align="after" padding="6pt">
<fo:block-container reference-orientation="90" display-align="center">
<fo:block>Text</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell display-align="after" padding="6pt">
<fo:block-container height="100%" reference-orientation="90" display-align="center">
<fo:block>Text</fo:block>
</fo:block-container>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell padding="6pt">
<fo:block>Text</fo:block>
</fo:table-cell>
<fo:table-cell padding="6pt">
<fo:block>Text</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
对于 Antenna House 5.3,我还没有找到如何创建一个 table 旋转 90 度的单元格 "left aligned"(所以,在页面的底部垂直)和 "vertically centered"(在页面中间水平)。我已经尝试了所有我认为可以的text-align display-align组合,但结果仍然是"top aligned"(垂直底部,水平左侧)。
您知道如何在旋转的 table 单元格中使文本左对齐并垂直居中吗?这是一个单元格的示例:
<fo:table-cell display-align="after">
<fo:block-container reference-orientation="90" display-align="center">
<fo:block>Text</fo:block>
</fo:block-container>
</fo:table-cell>
结果是文本在页面上没有从左到右居中。
使用 AH Formatter V6.6(我没有安装 V5.3),如果你给 table 列一个宽度(使用 fo:column
和 column-width
)并且在 fo:block-container
上设置 height="100%"
,然后格式化程序有更多的工作要做,以便它可以使列中的文本居中。
下面的屏幕截图来自启用了 'Show Border' 选项的 AH Formatter GUI,因此您可以看到区域的范围并看到第二个 fo:block-container
的(旋转)高度table header 单元格。
<fo:table start-indent="0" end-indent="0">
<fo:table-column column-width="50pt" />
<fo:table-column column-width="50pt" />
<fo:table-header>
<fo:table-row>
<fo:table-cell display-align="after" padding="6pt">
<fo:block-container reference-orientation="90" display-align="center">
<fo:block>Text</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell display-align="after" padding="6pt">
<fo:block-container height="100%" reference-orientation="90" display-align="center">
<fo:block>Text</fo:block>
</fo:block-container>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell padding="6pt">
<fo:block>Text</fo:block>
</fo:table-cell>
<fo:table-cell padding="6pt">
<fo:block>Text</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>