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: Re: [docbook-apps] Help with colsep border style, please

As you discovered, there is little to designate table styles in the DocBook
table markup. However, the table element supports a 'tabstyle' attribute.
That can be used to specify a named table style, and then it is up to the
stylesheet to implement each tabstyle.

As soon as Michael Smith releases the 1.67.2 stylesheet version, you can use
the table.cell.properties template to implement tabstyles. That template
(not an attribute-set) is called just after each fo:table-cell is started.
By default, it outputs the attributes for colsep, rowsep, align, valign, and
char that are set on the 'entry' element, or that are inherited from the
row, tbody or thead, or table elements. But you can test for the current
table's tabstyle, and change the attributes for each cell.

So you could copy the 'table.cell.properties' template from fo/table.xsl (in
1.67.2) to your customization, and replace the part that handles $colsep
with something like this:

 <xsl:variable name="tabstyle" select="(ancestor::table |
ancestor::informaltable) [last()]/@tabstyle"/>

    <xsl:when test="$tabstyle = 'styleA' and $col = 2">
      <xsl:attribute name="border-right">0.5pt dashed black</xsl:attribute>
        <xsl:if test="$colsep.inherit &gt; 0 and
                      $col &lt; ancestor::tgroup/@cols">
          <xsl:call-template name="border">
            <xsl:with-param name="side" select="'right'"/>

The variable 'tabstyle' holds the value of the @tabstyle attribute for the
table. Then it is tested, along with the column number, to determine if an
alternate border style should be used.  In this case, a table with a
tabstyle="styleA" attribute will have a dashed  column separator after
column 2.  If no match, then it will use the inherited colspec value.

You can create as many tabstyles as you like, as long as you are willing to
support them in table.cell.properties.

Bob Stayton
Sagehill Enterprises
DocBook Consulting

----- Original Message ----- 
From: "Bernhard Kohl" <kohl@hbz-nrw.de>
To: <docbook-apps@lists.oasis-open.org>
Sent: Wednesday, December 01, 2004 3:33 AM
Subject: [docbook-apps] Help with colsep border style, please

> Hi,
> in a docbook table there is a way to define if a column will
> have an associated line or not (colsep "1" or "0").
> But what I'm missing is a style attribute (dashed line).
> So far, I've found a way do do this for all cells of a table
> using a stylesheet parameter:
>    table.frame.border.style
>    table.cell.border.style
> But what is needed is a way to define this individually for
> each column.
> Any hints? Thanks in advance.
> Bernhard Kohl

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