This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: vertical centering of a block in XSL-FO.


Fred Romelfanger <fred@stsci.edu> wrote:
>I have two blocks that are beside each other in a table.  One block is
>larger than the other, and I want the smaller one centered vertically.


For vertical centering in table-cell, display-align="center" is the 
answer. For example:

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="all-pages">
      <fo:region-body margin="1in"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-name="all-pages">
    <fo:flow flow-name="xsl-region-body">
      <fo:table>
        <fo:table-column column-width="1in"/>
        <fo:table-column column-width="1in"/>
        <fo:table-body>
          <fo:table-row>
            <fo:table-cell display-align="center">
              <fo:block>This block is small.</fo:block>
            </fo:table-cell>
            <fo:table-cell display-align="center">
              <fo:block>
              This block is larger than the other.
              The smaller one is centered vertically.
              </fo:block>
            </fo:table-cell>
          </fo:table-row>
        </fo:table-body>
      </fo:table>
    </fo:flow>
  </fo:page-sequence>
</fo:root>


>I am currently using Apache's implementation of XSL-FO.

Unfortunately, in this moment Apache's FOP does not support 
display-align property. (I tested FOP 0.15)

Our implementation, Antenna House XSL Formatter supports this.
Please try it.
http://www.antennahouse.com/xslformatter.html


Regards,

MURAKAMI Shinyu
XSL-Dev, Antenna House, Inc.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]