XSL FO - 尊重填充
除了第 1 页之外,我的桌子上的所有内容都没有像我告诉的那样填充。我确实有一个 "first"
和一个 "Rest"
定义为
<!-- layout for the first page -->
<fo:simple-page-master master-name="first"
page-height="11in"
page-width="8.5in"
margin-top="1cm"
margin-bottom="2cm"
margin-left="2.5cm"
margin-right="2.5cm">
<fo:region-body margin-top="3cm"/>
<fo:region-before extent="2cm"/>
<fo:region-after extent=".1cm"/>
</fo:simple-page-master>
<!-- layout for the other pages -->
<fo:simple-page-master master-name="rest"
page-height="11in"
page-width="8.5in"
margin-top="1cm"
margin-bottom="2cm"
margin-left="2.5cm"
margin-right="2.5cm">
<fo:region-body margin-top="3cm"/>
<fo:region-before extent="2cm"/>
<fo:region-after extent=".1cm"/>
</fo:simple-page-master>
但是,我不知道这会如何影响我的填充。
<fo:block>
<!-- table start -->
<fo:table table-layout="fixed" width="100%" border-collapse="separate" padding-after="1em">
<fo:table-column column-width="15mm"/>
<fo:table-column column-width="46mm"/>
<fo:table-column column-width="28mm"/>
<fo:table-column column-width="22mm"/>
<fo:table-column column-width="19mm"/>
<fo:table-column column-width="30mm"/>
<fo:table-header>
<fo:table-cell>
<fo:block font-weight="bold" border-width="0.5mm" border-style="solid" >
<fo:inline padding-left="1mm">Model</fo:inline>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-weight="bold" border-width="0.5mm" border-style="solid" border-left="none">
<fo:inline padding-left="2mm">Description</fo:inline>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-weight="bold" border-width="0.5mm" border-style="solid" padding-left=".1mm" border-left="none">
<fo:inline padding-left="2mm">Material</fo:inline>
</fo:block>
</fo:table-cell>
请注意 padding-left
属性。为什么它在除第一页之外的所有页面上都没有得到尊重?
更新
我注意到这只发生在“溢出页面”上。当我的表有足够的数据可以换行到另一页时。如果是新表,问题就会消失。
On all except page-1 my table does not pad like I tell it to. I do have a "first"
and a "Rest"
defined as
<!-- layout for the first page -->
<fo:simple-page-master master-name="first"
page-height="11in"
page-width="8.5in"
margin-top="1cm"
margin-bottom="2cm"
margin-left="2.5cm"
margin-right="2.5cm">
<fo:region-body margin-top="3cm"/>
<fo:region-before extent="2cm"/>
<fo:region-after extent=".1cm"/>
</fo:simple-page-master>
<!-- layout for the other pages -->
<fo:simple-page-master master-name="rest"
page-height="11in"
page-width="8.5in"
margin-top="1cm"
margin-bottom="2cm"
margin-left="2.5cm"
margin-right="2.5cm">
<fo:region-body margin-top="3cm"/>
<fo:region-before extent="2cm"/>
<fo:region-after extent=".1cm"/>
</fo:simple-page-master>
But, I don't see how this would affect my padding.
<fo:block>
<!-- table start -->
<fo:table table-layout="fixed" width="100%" border-collapse="separate" padding-after="1em">
<fo:table-column column-width="15mm"/>
<fo:table-column column-width="46mm"/>
<fo:table-column column-width="28mm"/>
<fo:table-column column-width="22mm"/>
<fo:table-column column-width="19mm"/>
<fo:table-column column-width="30mm"/>
<fo:table-header>
<fo:table-cell>
<fo:block font-weight="bold" border-width="0.5mm" border-style="solid" >
<fo:inline padding-left="1mm">Model</fo:inline>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-weight="bold" border-width="0.5mm" border-style="solid" border-left="none">
<fo:inline padding-left="2mm">Description</fo:inline>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-weight="bold" border-width="0.5mm" border-style="solid" padding-left=".1mm" border-left="none">
<fo:inline padding-left="2mm">Material</fo:inline>
</fo:block>
</fo:table-cell>
Note the padding-left
attribute. Why doesn't it get respected on all but the first page?
UPDATE
I noticed this only happens on "overflow pages". When my table has enough data to wrap to another page. If its a new table, the problem goes away.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能是 XSL FO 处理器实现 APACHE FOP 的限制。我会联系他们。
This is probably a limitation of the XSL FO processor implementation, APACHE FOP. I will contact them.