[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Borders on column groups

Subject: Re: Borders on column groups
From: Gustaf Liljegren <gustaf.liljegren@xxxxxx>
Date: Fri, 07 Jun 2002 12:27:24 +0200
xsl border
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.