XSL:fo 个胶囊 table 行和单元格

XSL:fo capsules table rows and cells

大家好,有没有办法在 XSL:FO 中封装 table 的行和单元格,或者必须将 tables 封装到 tables 中以获得解决方案. 这是 table 应该是什么样子的图片:

您当然可以设置单独的边框,例如 border-left 和 border-top。要根据要求缩进文本内容,您可以为整个内容设置单元格的填充或单元格内块的边距。

            <fo:table width="100%">
            <fo:table-column column-width="33%"/>
            <fo:table-column column-width="33%"/>
            <fo:table-column column-width="33%"/>
            <fo:table-body>
                <fo:table-row>
                    <fo:table-cell padding-left="1in" border-left="1px solid red">
                        <fo:block>padding on cell</fo:block>
                    </fo:table-cell>
                    <fo:table-cell border-left="1px solid red">
                        <fo:block margin-left="1in">margin on block</fo:block>
                    </fo:table-cell>
                    <fo:table-cell border-left="1px solid red">
                        <fo:block>No padding</fo:block>
                    </fo:table-cell>
                </fo:table-row>
            </fo:table-body>
        </fo:table>

注意:您的结果将取决于您使用的渲染器。 Apache 错误地呈现了与最后一个单元格中的文本重叠的情况,而其他格式化程序则没有。您需要试用它以确保您对 FOP 满意。