[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] How to center a table?
| Hey Colin, Your solution works perfectly... if the table in question is exactly 10cm wide :) No worries, though, because�seeing that led me to some more investigation and trial-and-error, and now I believe that I have a solution that works for any size table, in case anyone else is interested: <xsl:template name="table.layout"> � � � � <xsl:param name="table.content" select="NOTANODE" /> � � � � <xsl:choose> � � � � � � <xsl:when test="@tabstyle='center'"> � � � � � � � � <fo:table table-layout="fixed" width="100%"> � � � � � � � � � � <fo:table-column /> � � � � � � � � � � <fo:table-column > �� � � � � � � � � � � � � � � � � � � � � � � � <!-- Set center column width equal to table width --> � � � � � � � � � � � � <xsl:attribute name="column-width"> � � � � � � � � � � � � � � <xsl:call-template name="table.width"/> � � � � � � � � � � � � </xsl:attribute> �� � � � � � � � � � � � � � � � � � � � � � </fo:table-column> � � � � � � � � � � <fo:table-column /> � � � � � � � � � � <fo:table-body> � � � � � � � � � � � � <fo:table-row> � � � � � � � � � � � � � � <fo:table-cell column-number="2"> � � � � � � � � � � � � � � � � <xsl:copy-of select="$table.content" /> � � � � � � � � � � � � � � </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> I think that with a few adjustments, it could also work for right-aligning a table. Ellen On May 25, 2007, at 12:34 PM, Colin Shapiro wrote: I should add that this wasn't with DocBook that I used this method (I replied without realizing), so this may not help you figure out how to customize the DocBook templates. Product Specialist, LCS Series Meyer Sound Laboratories |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]