This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Borders on column groups
At 00:15 2002-06-07 +0100, you wrote:
David wrote:
>don't you only want the rule to be drawn if the col is the last in its
>colgroup (and it's not the last colgroup) anyway if so that's something
>like (untested)
Thank you. It sounds right, but there's still something missing. Here's the
code for table header cells:
<!-- Table header cell -->
<xsl:template match="th">
<xsl:variable name="x" select="position()"/>
<fo:table-cell xsl:use-attribute-sets="table-padding">
<!-- Handle the rules attribute for 'groups' -->
<xsl:if test="ancestor::table[@rules='groups']">
<xsl:attribute name="border-bottom">
<xsl:value-of select="$border"/>
</xsl:attribute>
<xsl:if test="ancestor::table//col[$x]
[not(following-sibling::col) and
parent::colgroup/following-sibling::colgroup]">
<xsl:attribute name="border-right">
<xsl:value-of select="$border"/>
</xsl:attribute>
</xsl:if>
</xsl:if>
<!-- Handle the rules attribute for 'all' -->
<xsl:if test="ancestor::table[@rules='all']">
<xsl:attribute name="border-bottom">
<xsl:value-of select="$border"/>
</xsl:attribute>
<xsl:if test="ancestor::table//col[$x]
[parent::colgroup/following-sibling::colgroup]">
<xsl:attribute name="border-right">
<xsl:value-of select="$border"/>
</xsl:attribute>
</xsl:if>
</xsl:if>
<fo:block xsl:use-attribute-sets="table-header">
<xsl:value-of select="$x"/>
<!-- <xsl:apply-templates/> -->
</fo:block>
</fo:table-cell>
</xsl:template>
I changed <xsl:apply-templates/> to the value of $x to see what's
happening, and the result is even numbers (2, 4, 6 and 8) in the header
row. The variable $x should count all occurencies of <th> elements in the
current <tr>, shouldn't it? I had expected 1, 2, 3 and 4.
Gustaf
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list