OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: How to center a table?


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





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]