Re: [docbook-apps] How to center a table?

From
Colin Shapiro <>
Date
2007-05-25T19:30:29+00:00
ID
Thread
Re: [docbook-apps] How to center a table?
Hi,

The method shown on the FOP website has worked for me in the past (using FOP, of course):
http://xmlgraphics.apache.org/fop/fo.html#fo-center-table-horizon

Colin

On 5/25/07, Ellen Juhlin <> wrote:

Hello friendly list people,

 

I know this topic has come up in the past a few times, but none of the solutions I've found seem to be working out. I'm trying to center a table horizontally on a page. I'm using the XSL stylesheets 
v.1.72, DocBook 4.4, and XEP 3.7.7.

I've tried the method listed here: 
http://www.renderx.net/lists/xep-support/1444.html but it seems to create three equally-sized columns with my table left-aligned (and overflowing) in the middle column. I don't know if I'm "wrapping" the wrong template - I tried calsTable, 
table.layout, and make.table.content, all with either the same result, or no effect. I'm sure that I am just missing something very minor here... can someone point me in the right direction?

<xsl:template name="table.layout">

        <xsl:param name="table.content"
 select="NOTANODE" />

        <xsl:choose>

            <xsl:when test=
"@tabstyle='center'">

                <fo:table width
="100%">

                    <fo:table-column column-width
="proportional-column-width(1)"/>

                    <fo:table-column
 />

                    <fo:table-column column-width
="proportional-column-width(1)"/>

                    <fo:table-body>

                        <fo:table-row>

                            <fo:table-cell 
/>

                            <fo:table-cell>

                                <xsl:copy-of
 select="$table.content" />

                            </fo:table-cell>

                            <fo:table-cell 
/>

                        </fo:table-row>

                    </fo:table-body>

                </fo:table>

            </xsl:when>

            
<xsl:otherwise>

                <xsl:copy-of select=
"$table.content" />

            </xsl:otherwise>

        </xsl:choose>

    </xsl:template>

Please tell me what I am doing wrong!

Thanks,

Ellen

 

Product Specialist, LCS Series

Meyer Sound Laboratories