2016-05-16 7 views
0

Apache FOPを使用してPDFを生成しています。私はテーブルのセルの長さを超えている場合にのみ、テキストを折り返したい。私はwrap-option = "wrap"で試しました。それはスペース自体を見つけるときに単語を分割します。それはtable-cellの長さが超過しているかどうかを見ません。例えばWRAPオプションは、長さを超える前に単語をラップします

<fo:table width="33%" table-layout="fixed" position="fixed" margin-top="-21.5%" margin-left="68.5%"> 
    <fo:table-body> 
    <fo:table-row> 
     <fo:table-cell padding-bottom="3px" text-align="left" width="5cm" margin-left="1.2cm"> 
     <fo:block-container> 
      <fo:block wrap-option="wrap"> 
      <fo:inline font-family="TimesNewRoman" font-weight="bold"> 
       <xsl:value-of select="test/test1"/> 
      </fo:inline> 
      </fo:block> 
     </fo:block-container> 
     </fo:table-cell> 
    </fo:table-row> 
    </fo:table-body> 
</fo:table> 

:私は以下のような文字列を持っている:私はXSLTの上使用してPDFを生成すると

TEST 1 TEST 2 TEST 3 

、それは本家の

TEST 
1 
TEST 
2 
TEST 
3 

以下のように表示され、それはより多くのを持っています幅、それは分割して表示されます。私が表示したいと思いますどのように

は、誰もがこの上で私を助けることができる

TEST 1 TEST ..if length exceeds the length 
2 TEST 3 

enter image description here

のですか?

+1

'fo:table-cell'に実際のFO XMLマークアップを追加できますか?書式設定された表のセルのスクリーンショットを追加できますか?あなたが描いていることは、私が起こると予想されるものでもありません。 'fo:table'の余白や開始インデントを設定していますか?これはすべての列に対して、または1つの列にのみ発生しますか? –

+0

すべての列で起こっています。また、私はその表のセルの余白プロパティを設定しています。 –

+0

テーブルレイアウト= "固定"位置= "固定" margin-top = " - 21.5%" margin-left = "68.5%"> \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t

答えて

1

fo:table-bodystart-indent="0pt"を追加します。

<fo:table width="33%" table-layout="fixed" 
     position="fixed" margin-top="-21.5%" margin-left="68.5%"> 
    <fo:table-body start-indent="0pt"> 
    <fo:table-row> 
     <fo:table-cell padding-bottom="3px" text-align="left" width="5cm"> 
     <fo:block> 
      <fo:inline font-family="TimesNewRoman" font-weight="bold" 
     > TEST 1 TEST 2 TEST 3 </fo:inline> 
     </fo:block> 
     </fo:table-cell> 
    </fo:table-row> 
    </fo:table-body> 
</fo:table> 

fo:table/@margin-leftた各fo:table-cellの内容についてstart-indent形質を出て作業する際に使用される継承されたstart-indent値を設定します。詳細はhttps://www.w3.org/TR/xsl11/#refine-margin-space-indentを参照してください。

また、fo:table-cell/@margin-leftfo:block-container、およびfo:block/@wrap-optionも何も追加していませんでした。

+0

ありがとうございました。それはうまくいく。 –

+0

また、私はそのテーブルセルを特定の位置に設定したいと思います。私はを試してみました。それは私にとってはうまくいきません。あなたが私にこのシナリオで何をしなければならないか、親切に教えてください。 –

+0

あなたがしたいことを正確に説明する別の質問を始めてください。 –

関連する問題