xsl-list
[Top] [All Lists]

[xsl] XSL-FO: Centering text vertically in a table column

2007-02-06 03:05:08
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(_at_)warpspeed(_dot_)com(_dot_)au
FAX:    +61-3-9395-7633   Web Page:   http://www.warpspeed.com.au
Postal: WarpSpeed Computers, PO Box 4293, Hoppers Crossing DC, VIC 3029, 
AUSTRALIA




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>