如何在XSL-FO中的旋转表格单元格中水平对齐文本?

时间:2019-05-30 19:57:00

标签: xsl-fo antenna-house

在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>

结果是文本不在页面上从左到右居中。

1 个答案:

答案 0 :(得分:0)

如果您给表列指定宽度(使用fo:columncolumn-width并设置height="100%",请使用AH Formatter V6.6(我没有安装V5.3)在fo:block-container上,则格式化程序还有更多工作需要,以便它可以使文本在列中居中。

下面的屏幕快照来自AH Formatter GUI,其中启用了“显示边框”选项,以便您可以在第二个表标题单元格中看到区域的范围并查看fo:block-container的(旋转)高度。

Screenshot of table in AH Formatter GUI

<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>
相关问题