你好,我有两个表格单元格和一个 <fo:leader/>
在两个单元格中。我怎样才能避免在两个单元格之间留出空间。不可能跨越两个单元格。
我使用 Antennahouse 和 XSLT 2.0。
这是我的表格代码
<fo:table width="100%" >
<fo:table-column column-width="50%"/>
<fo:table-column column-width="50%"/>
<fo:table-body >
<fo:table-row>
<fo:table-cell >
<fo:block border-right-width="0.0mm" >
<xsl:if test="page">
<xsl:attribute name="text-align-last">justify</xsl:attribute>
</xsl:if>
<xsl:value-of select="concat(@ref1,' ')"/>
<xsl:if test="page">
<fo:leader leader-pattern="dots"/>
</xsl:if>
</fo:block>
</fo:table-cell>
<fo:table-cell >
<fo:block text-align="justify" text-align-last="right" axf:text-align-first="justify">
<xsl:if test="page">
<fo:leader leader-pattern="dots" />
</xsl:if>
<fo:inline><xsl:apply-templates select="page" mode="normal"><xsl:with-param name="chapter" select="@chapterNumber"></xsl:with-param></xsl:apply-templates></fo:inline></fo:block>
</fo:table-cell>
</fo:table-row>
最佳答案
没有你拥有的所有其他东西,使用纯 XSL FO 并且没有扩展这对我有用:
<fo:table width="100%" >
<fo:table-column column-width="50%"/>
<fo:table-column column-width="50%"/>
<fo:table-body >
<fo:table-row>
<fo:table-cell>
<fo:block text-align-last="justify">
<fo:inline>Stuff</fo:inline>
<fo:leader leader-pattern="dots"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align-last="justify">
<fo:leader leader-pattern="dots" />
<fo:inline>1</fo:inline></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
没有空格。
针对这个问题,我有没有可能走运?再次测试,各种内容和表格列宽。我显示的内容可能是紧缩的并且有不同的长度,并且我改变了表格单元格的大小。在所有情况下都没有间隙。
我测试了其他一些东西并意识到不同之处在于格式化程序。 Apache FOP 和 Antennahouse 产生了你所展示的问题,我使用的是 RenderX XEP(我为之工作)。它不会表现出这种行为。恕我直言,如果您的格式化程序具有允许字符间和单词空间压缩以适应允许的公差的算法,则正确答案是没有空格。 Justified就是“有理有据”。
https://stackoverflow.com/questions/38503384/