我创建了一个带有表格的 pdf 模板。
表格有边框;渲染完所有数据后,内容只覆盖了页面的一半,所以表格边框只覆盖了内容。
但我希望表格边框覆盖整个页面,无论内容的高度如何,如下所示:
- 我试图将桌子的高度设置为 100%,但没有运气。
- 我也试过放在
block-progression-dimension.optimum="100%"
最后一个表格单元格;让我知道那是否是正确的地方
<fo:page-sequence master-reference="A4-portrait">
<fo:flow flow-name="xsl-region-body">
<fo:block font-size="14pt" margin-bottom="11pt" height="100%">
<fo:table border-width="1pt" border-style="solid" height="100%" border-color="grey" margin-top="-110pt" font-family="Gotham Narrow A, Gotham Narrow B, Helvetica, Arial, sans-serif">
<fo:table-body>
<fo:table-row>
<fo:table-cell number-columns-spanned="2" margin-left="20pt">
<fo:block text-align="left" font-weight="bold" font-size="13pt" color="black" margin-bottom="2pt" margin-top="15pt" margin-left="-5pt">
${ctx.messages.repairInstructionTitle}
</fo:block>
<fo:block text-align="left" font-size="9pt" color="black">
${ctx.messages.repairInstructionMessage1}
</fo:block>
<fo:block text-align="left" font-size="9pt" color="black">
${ctx.messages.repairInstructionMessage2}
</fo:block>
<fo:block text-align="left" font-size="9pt" color="black">
${ctx.messages.repairInstructionMessage3}
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:table margin-top="10pt" margin-bottom="15pt">
<fo:table-column column-width="50%"/>
<fo:table-column column-width="50%"/>
<fo:table-body>
<fo:table-row>
#if ($ctx.orderData.deliveryAddress.country.isocode == 'US')
<fo:table-cell margin-left="30pt" number-columns-spanned="1">
<fo:block text-align="left" font-weight="bold" font-size="9pt" color="black">
${ctx.messages.repairQuestionForLocationMainland}
</fo:block>
<fo:block text-align="left" font-size="9pt" color="black">
${ctx.messages.mauijimIncMainland}
</fo:block>
<fo:block text-align="left" font-size="9pt" color="black">
${ctx.messages.repairDepartmentLable}
</fo:block>
<fo:block text-align="left" font-size="9pt" color="black">
${ctx.messages.repairDepartmentMainlandAddressLine1}
</fo:block>
<fo:block text-align="left" font-size="9pt" color="black">
${ctx.messages.repairDepartmentMainlandAddressLine2}
</fo:block>
</fo:table-cell>
<fo:table-cell margin-left="20pt">
<fo:block text-align="left" font-weight="bold" font-size="9pt" color="black">
${ctx.messages.repairQuestionForLocationHawaii}
</fo:block>
<fo:block text-align="left" font-size="9pt" color="black">
${ctx.messages.mauijimIncHawaii}
</fo:block>
<fo:block text-align="left" font-size="9pt" color="black">
${ctx.messages.repairDepartmentLable}
</fo:block>
<fo:block text-align="left" font-size="9pt" color="black">
${ctx.messages.repairDepartmentHawaiiAddressLine1}
</fo:block>
<fo:block text-align="left" font-size="9pt" color="black">
${ctx.messages.repairDepartmentHawaiiAddressLine2}
</fo:block>
</fo:table-cell>
#end
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell margin-left="15pt" block-progression-dimension.optimum="100%">
<fo:block text-align="left" font-size="13pt" color="black" font-weight="bold">
${ctx.messages.repairAnyQuestionText}
</fo:block>
#if (${ctx.orderData.deliveryAddress.country.isocode} == 'US')
<fo:block text-align="left" font-size="9pt" color="black">
${ctx.messages.repairContactInfo}
</fo:block>
#end
#if (${ctx.orderData.deliveryAddress.country.isocode} != 'US')
<fo:block text-align="left" font-size="9pt" color="black">
#set($repairContactInfo = "repairContactInfo")
#set($isocode = $ctx.orderData.deliveryAddress.country.isocode )
#set($addMessage = "$repairContactInfo$isocode")
${ctx.messages.getMessage($addMessage)}
</fo:block>
#end
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:flow>
</fo:page-sequence>