如何获取 table/element 的高度作为变量?

How do I get the height of a table/element as a variable?

我在 <fo:layout-master-set>tag

中设置了这些
<fo:region-body margin-top="5cm" margin-bottom="2cm"/>
<fo:region-before extent="5cm"/>
<fo:region-after extent="1.5cm"/>

我在 region-before 中声明了一个 table。这是为了使其在以 pdf 格式生成时在每个页面上重复。 table 的高度是动态的,但行数 (5) 是固定的。因此,我的 margin-top 也需要是一个变量。

如何获取 region-before 中 table 的最终高度,将其放入变量并将其传递给 region-body 的 margin-top?

将 table 本身放入另一个 table 的 table header 中,该 table 的一个单元格包含整个页面的 body 内容。 header 中的 table 将在每一页上重复