AH Formatter / XSL Formatter
Q&A



XSLT/XSL-FO/MathML テクニック

マージン/インデント

トップ
基本・一般
AH Formatter について
XSL Formatter について
操作方法
プログラミング
XSLT/XSL-FO/SVG/MathML 仕様について
XSLT/XSL-FO/MathML テクニック
索引
Q.  次のように padding-before="xx%" を指定しました。取得できる padding-before の値は fo:table-cell の高さに対する割合になると考えたのですが、違うようです。どのように計算されているのでしょうか。
<fo:table-body> 
  <fo:table-row>
    <fo:table-cell padding-before="1%">
      <fo:block>...
[No.2005032501]
A. 

W3Cの勧告の 7.29.15 "padding" には以下のように記述されています。

CSS2 Definition:

Value: <padding-width>{1,4} | inherit
Initial: not defined for shorthand properties
Applies to: all elements
Inherited: no
Percentages: refer to width of containing block
Media: visual

これによると padding-before の "%" は周りの block の幅に対する割合ということです。したがって、ご質問のコードの場合は table の幅(= table-row の幅)ということになります。fo:table-cell の高さに対する割合を指定するためには、from-nearest-specified-value を使用した次のような記述で実現できます。

<fo:table-cell padding-before="from-nearest-specified-value(height) * 0.01">

Copyright © 1999-2011 Antenna House, Inc. All rights reserved.
Antenna House is a trademark of Antenna House, Inc.