xsl-fo - 如何在 XSL-FO 中的旋转表格单元格中水平对齐文本?
问题描述
使用 Antenna House 5.3,我还没有找到如何创建一个旋转 90 度的表格单元格“左对齐”(因此,在页面的垂直底部)和“垂直居中”(在页面的中间水平)。我已经尝试了所有我认为可以的 text-align display-align 组合,但结果仍然是“顶部对齐”(垂直底部,水平左侧)。
您知道如何在旋转的表格单元格中使文本左对齐并垂直居中吗?这是一个单元格的示例:
<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),如果您为表格列指定宽度(使用fo:column
and column-width
)并设置height="100%"
在fo:block-container
在列中。
下面的屏幕截图来自启用了“显示边框”选项的 AH Formatter GUI,以便您可以查看区域的范围并查看fo:block-container
第二个表格标题单元格中的(旋转)高度。
<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>
推荐阅读
- typescript - 指示对象具有除已知属性外的任意数量的 key:string 属性
- php - 带双引号的 PhpSpreadsheet 字符串
- c# - 如何在 MySQL / C# 中检查字段是否为空
- regex - 在一组 REGEXP 字符值中包含新行
- python - WTForms DateField 返回无
- python - 根据条件将时间序列从一个df映射到另一个df
- android - 隐藏键盘时将聊天滚动到底部
- sql - 如何在返回某些值时修改它们
- typo3 - 在 TYPO3 Fluid 模板中的变量上防止 htmlspecialchars
- python - Python:执行时 fbs 无法正常工作