2012-08-25 45 views
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> 

回答

1

我相信解决方案将是绝对测量而不是百分比。