4
目前我正在使用XSL-FO生成PDF文件。事实上,我直接编写FO对象而不是分离XML和XSL。这是我们目前的要求。我们可以正确对齐文本。但是,当我们在桌子上时,保持中心不显示完整的桌子。可能是什么问题呢。在这里,我张贴我试过的代码:XSL-FO表中心
<fo:block>
<fo:table width="80%"
border-style="solid"
border-width="1pt"
border-color="#69468D"
table-layout="fixed"
space-before="10px"
space-after="10px"
text-align="start">
<fo:table-header line-height="10pt"
font-size="6pt"
background-color="#69468D"
color="white"
padding-top="3pt">
<fo:table-row>
<fo:table-cell border-top-color="solid pruple" border-left-color="solid pruple" border="1pt solid white">
<fo:block>text</fo:block>
</fo:table-cell>
<fo:table-cell border="0.5pt solid pruple" padding="4pt">
<fo:block>text</fo:block>
</fo:table-cell>
<fo:table-cell border="0.5pt solid pruple" padding="4pt">
<fo:block>text</fo:block>
</fo:table-cell>
<fo:table-cell border="0.5pt solid pruple" padding="4pt">
<fo:block>text</fo:block>
</fo:table-cell>
<fo:table-cell border="0.5pt solid pruple" padding="4pt">
<fo:block>text</fo:block>
</fo:table-cell>
<fo:table-cell border="0.5pt solid pruple" padding="4pt">
<fo:block>Text</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body line-height="5pt"
font-size="6pt">
<fo:table-row padding-top="3pt">
<fo:table-cell text-align="center">
<fo:block>
hi
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="center">
<fo:block>
hi
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>