繁体   English   中英

表XSL-FO中的分页符

[英]Page break inside table XSL-FO

我有一个表的XSL-FO样式表。

<fo:page-sequence master-reference="defaultPage">
  <fo:flow flow-name="xsl-region-body">
    <fo:table table-layout="fixed" width="100%">
      <fo:table-column column-width="9pt"/>
      <fo:table-column column-width="30pt"/>
      <fo:table-column column-width="150pt"/>
      <fo:table-header>
        <fo:table-row>
          <fo:table-cell>
            <fo:block><xsl:text>Column 1</xsl:text></fo:block>
          </fo:table-cell>
          <fo:table-cell>
            <fo:block><xsl:text>Column 2</xsl:text></fo:block>
          </fo:table-cell>
          <fo:table-cell>
            <fo:block><xsl:text>Column 3</xsl:text></fo:block>
          </fo:table-cell>
        </fo:table-row>
      </fo:table-header>
      <fo:table-body>
        <fo:table-row>
          <xsl:apply-templates select="rbrOcjena"/>
          <xsl:apply-templates select="sifPred"/>
          <xsl:apply-templates select="nazPred"/>
        </fo:table-row>
      </fo:table-body>
    </fo:table>
  </fo:flow>
</fo:page-sequence>

该表可以有很多行,所以当生成PDF时,我想在新页面上打破它。 此外,我想在新页面重复表头,如果可能的话。 我应该在表格标签中添加哪些属性来实现它?

谢谢!

该表可以有很多行,所以我想在当前结束时在新页面上将其分解

如果没有看到你的XSL-FO代码,就很难回答这个问题。 请出示。 但一般来说,这是通过保持和休息来完成的。 例如:

<fo:table-row keep-together.within-page="always">

我想在新页面上重复表格标题,如果可能的话。 我应该在表格标签中添加哪些属性来实现它?

指示XSL-FO处理器在每个页面的顶部重复多行不是通过fo:table的属性完成的。 相反,要重复的行放在fo:table-header

<fo:table-header>
   <fo:table-row>
      <fo:table-cell>
         <!--Block and text content-->
      </fo:table-cell>
   </fo:table-row>
</fo:table-header>

然后,处理器的默认行为应该是在分页后重复标题行。 那是因为fo:tableomit-header-at-break属性默认设置为“false”

最明显的原因是它立即清楚哪些行属于标题,因此应该重复。 如果这只是fo:table属性中的引用,则将多行标识为标题将更加困难。 您将在此处找到XSL规范的相关部分。

我遇到过类似的情况......

试试以下代码......

 <fo:table-row>
    <xsl:if test="position() != 1">
    <xsl:attribute name="break-before">page</xsl:attribute></i>
.
.
.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM