PDF-XSLT中表格内容渲染不对称问题求助
双列表格PDF渲染不对称问题
我编写了一个简单的双列表格,但在PDF渲染时出现不对称情况(附截图)。以下是表格代码示例:
<xsl:template name="Header"> <fo:table table-layout="fixed" width="100%"> <fo:table-column column-width="proportional-column-width(1.2)" border-style="solid"/> <fo:table-column column-width="proportional-column-width(2)" border-style="solid"/> <fo:table-body> <fo:table-row> <fo:table-cell column-number="1"> <fo:block font-size="3.5mm"> <xsl:value-of select="xpath/get/element-val"/> </fo:block> </fo:table-cell> <fo:table-cell column-number="2"> <fo:block font-size="3.5mm"> <xsl:value-of select="xpath/get/element-val"/> </fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </xsl:template>
我未使用复杂设置,期望两列均按第二列样式渲染,但尝试添加padding无效。
更新
曾尝试display-align="after",但无效果。
进一步更新
以下是模板调用流程:
<xsl:template name="Details"> <fo:block font-size="4.3mm" space-after.precedence="force" space-after="-3.5mm"> Testimonial is. <fo:leader leader-pattern="rule" alignment-baseline="before-edge" rule-thickness=".5mm" leader-length="255.4mm" color="cmyk(0,0,0,1)"/> </fo:block> <!--Here page available width is 255.4 only--> <xsl:call-template name="Temp2"/> <xsl:call-template name="Header"/> </xsl:template> <xsl:template name="Temp2"> <fo:table table-layout="fixed" width="100%"> <fo:table-column column-width="33mm"/> <fo:table-column column-width="proportional-column-width(1)"/> <fo:table-body> <fo:table-row> <xsl:for-each select="xpath/get/element-val"> <xsl:if test=".='D'"> <fo:table-cell column-number="1"> <fo:block> <fo:inline font-size="3.4mm" text-decoration="underline" writing-mode="lr"> <xsl:value-of select="following-sibling::*[1]"/> </fo:inline> </fo:block> </fo:table-cell> </xsl:if> </xsl:for-each> <xsl:for-each select="xpath/get/element-val"> <xsl:if test=".='E'"> <fo:table-cell column-number="2"> <fo:block font-size="3.4mm" writing-mode="lr" padding-top="1mm"> <xsl:value-of select="concat(.,' ',following-sibling::*[1])"/> </fo:block> </fo:table-cell> </xsl:if> </xsl:for-each> </fo:table-row> </fo:table-body> </fo:table> </xsl:template>
内容的提问来源于stack exchange,提问作者Rito Sarkar
相关产品推荐
相关产品推荐

