如何在XSL FO中将表格与页面底部对齐 [英] How to align table to the bottom of a page in XSL FO
问题描述
我在XSL FO中的绝对定位有问题.创建文档时,我必须在页面底部添加一个表格.问题在于桌子的高度未知. 以下示例显示了我的努力,但表格仍与页面顶部对齐.
I have a problem with absolute positioning in XSL FO. When creating a document I have to add a table to the bottom of a page. The problem is that the height of the table is not known. The following example shows my effort, but still the table is aligned to the top of the page.
<fo:block-container
bottom="1cm"
left="0"
width="100%"
height="auto"
position="absolute">
<fo:table
border="0.5pt solid black"
border-collapse="collapse"
text-align="left"
table-layout="fixed"
width="100%"
background-color="white"
font-size="7pt">
<fo:table-column column-width="60%"/>
<fo:table-column column-width="40%"/>
<fo:table-body>
<fo:table-row border="0.5pt solid black">
<fo:table-cell
border="inherit"
display-align="center"
padding="1pt"
padding-left="2pt">
<fo:block>abcde</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row border="0.5pt solid black">
<fo:table-cell
border="inherit"
display-align="center"
padding="1pt"
padding-left="2pt">
<fo:block>abcde</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block-container>
所以问题是:在不知道表格高度的情况下如何将表格与页面底部对齐吗?
我也尝试将表放在页脚中,但是如果我不知道该高度,则无法设置之后区域的范围.
I tried also to put the table in a footer, but if I don't know the hieght, I can't set the extent of the region-after.
注意:我有一个块容器,其宽度和高度与页面相同.上面的代码在此容器中.
注意2:我使用的是fop 1.1
推荐答案
将其放在脚注中.从身体区域的底部长到任意高度.我告诉我的学生,这种技术对法律文件最后一页底部的免责声明等有用.不需要块容器;无需测量.
Throw it into a footnote. That grows up from the bottom of the body region to an arbitrary height. I tell my students this technique is useful for things like disclaimers at the bottom of the last page of a legal document. No block containers are needed; no measurements needed.
这篇关于如何在XSL FO中将表格与页面底部对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!