gpt4 book ai didi

xslt - 有没有办法在 XSL-FO 中使用相当于 'rowspan' 的值?

转载 作者:行者123 更新时间:2023-12-03 22:52:58 27 4
gpt4 key购买 nike

我想在 <fo:table> 的最左边一列中显示一个更大字体的文本.然而,右边的列应该由几行文本组成。

这是在添加任何具有较大文本的最左侧列之前 XSL 代码的样子:

<xsl:template name="printAddress">
<xsl:param name="subDocument" />
<fo:table table-layout="fixed" background-color="#e0e0e0" keep-with-next.within-page="always">
<fo:table-column column-width="7.0cm" />
<fo:table-column column-width="7.0cm" />
<fo:table-column column-width="2.0cm" />
<fo:table-body>
<!-- Begin Row 1 -->
<fo:table-row keep-with-previous="always">
<fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm">
<fo:block>Value 1</fo:block>
</fo:table-cell>
<fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm">
<fo:block>Value 2</fo:block>
</fo:table-cell>
<fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm">
<fo:block />
</fo:table-cell>
</fo:table-row>
<!-- Begin Row 2 -->
<fo:table-row keep-with-previous="always">
<fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm">
<fo:block>
<xsl:value-of select="$subDocument/someAttribute" />
</fo:block>
</fo:table-cell>
<fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm">
<fo:block>
<xsl:value-of select="$subDocument/someOtherAttribute" />
</fo:block>
</fo:table-cell>
<fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm">
<fo:block />
</fo:table-cell>
</fo:table-row>
<!-- Begin Row 3 -->
<fo:table-row keep-with-previous="always">
<fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm">
<fo:block>value 3</fo:block>
</fo:table-cell>
<fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm">
<fo:block>Value 4</fo:block>
</fo:table-cell>
<fo:table-cell margin-left="0.2cm" padding-before="0.1cm" padding-after="0.1cm">
<fo:block>Value 5</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:template>

我想在左侧添加一列,但找不到它的语法。在 HTML 中,上面会写成这样:
<tr>
<td>Value 1</td>
<td>Value 2</td>
<td></td>
</tr>
<tr>
<td>{someAttribute}</td>
<td>{someOtherAttribute}</td>
<td></td>
</tr>
<tr>
<td>Value 3</td>
<td>Value 4</td>
<td>Value 5</td>
</tr>

为了完成我想要的,我们只需要像这样修改它:
<tr>
<td rowspan="3" style="font-weight:bold;font-size:14pt">New Text</td>
<td>Value 1</td>
<td>Value 2</td>
<td></td>
</tr>
<tr>
<td>{someAttribute}</td>
<td>{someOtherAttribute}</td>
<td></td>
</tr>
<tr>
<td>Value 3</td>
<td>Value 4</td>
<td>Value 5</td>
</tr>

但是对于 XSL-FO,如何最好地做到这一点呢?

最佳答案

<fo:table-cell number-rows-spanned="3">
难道您不喜欢 XSL 的罗嗦吗?

关于xslt - 有没有办法在 XSL-FO 中使用相当于 'rowspan' 的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1713699/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com