【问题标题】:How to align the fo:table to the right or to the center inside of the fo:table-cell in XSL-FO?如何在 XSL-FO 中将 fo:table 与 fo:table-cell 的右侧或中心对齐?
【发布时间】:2016-01-09 22:45:49
【问题描述】:

我忘记了 XSL Formatting Objects 的布局模型。
我积极使用它,但我现在不记得了。

以下代码错误

<fo:block background-color="gray" text-align="right">
    <fo:table background-color="yellow">
        <fo:table-body>
            <fo:table-row>
                <fo:table-cell><fo:block>99999999999</fo:block></fo:table-cell>
            </fo:table-row>
        </fo:table-body>
    </fo:table>
</fo:block>

如何使我的表格居中或向右对齐?

【问题讨论】:

    标签: xsl-fo


    【解决方案1】:

    嗯.. 我忘记将 fo:table 包裹在 &lt;fo:table-and-caption&gt; 内。
    此代码是一个工作示例

    <fo:block background-color="green" text-align="right">
        <fo:table-and-caption>
            <fo:table background-color="yellow">
                <fo:table-body>
                    <fo:table-row>
                        <fo:table-cell><fo:block>99999999999</fo:block></fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>
        </fo:table-and-caption>
    </fo:block>
    

    【讨论】:

    • 您可以将background-colortext-align 属性放在fo:table-and-caption 上并省略fo:block
    • @TonyGraham 为了我的格式化程序之一,有理由不这样做。可能是一个旧的天线屋。现在什么都不记得了。
    猜你喜欢
    • 1970-01-01
    • 2019-01-18
    • 1970-01-01
    • 2019-04-13
    • 2019-05-21
    • 1970-01-01
    • 2020-01-08
    • 2015-06-05
    • 2017-12-22
    相关资源
    最近更新 更多