2017-02-16 1 views
0

Je suis XSL-FO (fop apache) Je veux placer 3 tables côte à côte! Essayé beaucoup de chose, mais n'a pas encore trouvé la solution. Ce est la paix importante de mon code:XSL-FO Place 3 tables côté bij

<fo:table table-layout="fixed" width="60mm" keep-together.within-page="always" border-width="1pt" border-style="solid" border-color="black" > 

         <fo:table-column column-width="40mm"/> 
         <fo:table-column column-width="20mm"/> 

         <fo:table-body> 

         <fo:table-row> 
          <fo:table-cell text-indent="1mm"> 
           <fo:block>test:</fo:block> 
          </fo:table-cell> 
          <fo:table-cell> 
           <fo:block>test</fo:block> 
         </fo:table-cell> 
        </fo:table-row> 

         </fo:table-body> 

        </fo:table> 

Maintenant, je veux ajouter 3 les mêmes tables côte à côte. Quelqu'un peut-il aider?

+0

Décrivez davantage ce qui se passe quand un ou plusieurs vont sur une page et ce qui se passe quand l'un est plus long que les autres. Aussi, les hauteurs de rang sont-elles toutes différentes ou identiques? –

+0

Bonjour @KevinBrown 3 tables sur une demi-page la hauteur n'a pas d'importance, je veux juste savoir comment les mettre côté bij côté. toutes les hauteurs des tables sont les mêmes – user3356007

Répondre

1

Placer chacune des tables dans des blocs-blocs positionnés l'un à côté de l'autre. Comme ceci:

  <fo:block-container absolute-position="absolute" top="1in" left="0in" width="2.4in"> 
      <fo:table> 
       <fo:table-body> 
        <fo:table-row> 
         <fo:table-cell border="1pt solid black"> 
          <fo:block>I am Table 1</fo:block> 
         </fo:table-cell> 
         <fo:table-cell border="1pt solid black"> 
          <fo:block>I am Table 1</fo:block> 
         </fo:table-cell> 
        </fo:table-row> 
       </fo:table-body> 
      </fo:table> 
     </fo:block-container> 
     <fo:block-container absolute-position="absolute" top="1in" left="2.5in" width="2.4in"> 
      <fo:table> 
       <fo:table-body> 
        <fo:table-row> 
         <fo:table-cell border="1pt solid black"> 
          <fo:block>I am Table 2</fo:block> 
         </fo:table-cell> 
         <fo:table-cell border="1pt solid black"> 
          <fo:block>I am Table 2</fo:block> 
         </fo:table-cell> 
        </fo:table-row> 
       </fo:table-body> 
      </fo:table> 
     </fo:block-container> 
     <fo:block-container absolute-position="absolute" top="1in" left="5in" width="2.4in"> 
      <fo:table> 
       <fo:table-body> 
        <fo:table-row> 
         <fo:table-cell border="1pt solid black"> 
          <fo:block>I am Table 3</fo:block> 
         </fo:table-cell> 
         <fo:table-cell border="1pt solid black"> 
          <fo:block>I am Table 3</fo:block> 
         </fo:table-cell> 
        </fo:table-row> 
       </fo:table-body> 
      </fo:table> 
     </fo:block-container> 

Rendement:

enter image description here

Il existe d'autres moyens, mais je ne pense pas qu'ils sont pris en charge par FOP. Si vous utilisiez RenderX, vous pourriez utiliser une section rx: flow-section de 3 colonnes et mettre une table dans chacune des colonnes.

+0

Excellente solution! – user3356007