[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSL FO: how to centre tables

Subject: XSL FO: how to centre tables
From: Sebastian Rahtz <sebastian.rahtz@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 2 Jul 1999 13:58:20 +0000 (GMT)
centre tables
I am getting confused, and wonder if anyone who knows XSL FOs could
help out. I want to specify a table, whose caption and body will be centered on
the page width. So I have done this:

<xsl:template match='table'>
 <fo:table-and-caption>
   <fo:caption>
     <fo:block text-align-last="centered">
      <xsl:text>Table </xsl:text>
          <xsl:number level="1"/><xsl:text>. </xsl:text>
      <xsl:apply-templates select="head"/>
     </fo:block>
   </fo:caption>
   <fo:table-body>
     <xsl:for-each select="row">
       <fo:table-row>
          <xsl:for-each select="cell">
           <fo:table-cell>
              <xsl:apply-templates/>
           </fo:table-cell>
          </xsl:for-each>
       </fo:table-row>
      </xsl:for-each>
   </fo:table-body>
 </fo:table-and-caption>
</xsl:template>


really simple, yes? the caption is centered, correctly, but what do I
do to make the <fo:table-body> centre itself?

Unless I mistake, a <table> must directly contain a <table-body> which 
must directly contain <table-row>s. So there is no room for a <block>
in there.

sebastian


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.