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

XSL-FO: Centering text vertically in a table column

Subject: XSL-FO: Centering text vertically in a table column
From: "Chris Graham [WarpSpeed]" <chrisg@xxxxxxxxxxxxxxxx>
Date: Tue, 06 Feb 2007 21:02:33 +1100 (EDT)
 XSL-FO: Centering text vertically in a table column
Hello all.

Just how does one do it?

Here is the sample family tree table:

                        <fo:table table-layout="fixed" border-style="solid">
                            <fo:table-column column-width="3cm" />
                            <fo:table-column column-width="3cm" />
                            <fo:table-column column-width="3cm" />
                            <fo:table-body>
                                <fo:table-row>
                                    <fo:table-cell number-rows-spanned="4" border="1pt solid blue">
                                        <fo:block>PD</fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell number-rows-spanned="2" border="1pt solid blue">
                                        <fo:block>PDD</fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell number-rows-spanned="1" border="1pt solid blue">
                                        <fo:block>PDDD</fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <fo:table-row>
                                    <fo:table-cell number-rows-spanned="1" border="1pt solid pink">
                                        <fo:block>PDDB</fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <fo:table-row>
                                    <fo:table-cell number-rows-spanned="2" border="1pt solid pink">
                                        <fo:block>PDB</fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell number-rows-spanned="1" border="1pt solid blue">
                                        <fo:block>PDBD</fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <fo:table-row>
                                    <fo:table-cell number-rows-spanned="1" border="1pt solid pink">
                                        <fo:block>PDBB</fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <fo:table-row>
                                    <fo:table-cell number-rows-spanned="4" border="1pt solid pink">
                                        <fo:block>PB</fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell number-rows-spanned="2" border="1pt solid blue">
                                        <fo:block>PBD</fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell number-rows-spanned="1" border="1pt solid blue">
                                        <fo:block>PBDD</fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <fo:table-row>
                                    <fo:table-cell number-rows-spanned="1" border="1pt solid pink">
                                        <fo:block>PBDB</fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <fo:table-row>
                                    <fo:table-cell number-rows-spanned="2" border="1pt solid pink">
                                        <fo:block>PBB</fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell number-rows-spanned="1" border="1pt solid blue">
                                        <fo:block>PBBD</fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <fo:table-row>
                                    <fo:table-cell number-rows-spanned="1" border="1pt solid pink">
                                        <fo:block>PBBB</fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                            </fo:table-body>
                        </fo:table>

This is what I get:

PD	PDD	PDDD
		PDDB
	PDB	PDBD
		PDBB
PB	PBD	PBDD
		PBDB
	PBB	PBBD
		PBBB

But, this is what I need:

	PDD	PDDD
PD		PDDB
	PDB	PDBD
		PDBB
	PBD	PBDD
PB		PBDB
	PBB	PBBD
		PBBB

The PD, and PB are centered within their column. (As should PDD, PDB, PBD and PBB, the Pxxx's should also be centered within their cell as well.

This is using Apache FOP.

-Chris

-Chris

WarpSpeed Computers - The Graham Utilities for OS/2.
Voice:  +61-3-9395-1504   Internet:   chrisg@xxxxxxxxxxxxxxxx
FAX:    +61-3-9395-7633   Web Page:   http://www.warpspeed.com.au
Postal: WarpSpeed Computers, PO Box 4293, Hoppers Crossing DC, VIC 3029, AUSTRALIA

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-2011 All Rights Reserved.