This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] Table head output in FO
- From: "Bob Stayton" <bobs at sagehill dot net>
- To: "Pirjo Tinat" <ptinat at yahoo dot com>, <docbook-apps at lists dot oasis-open dot org>
- Date: Tue, 2 Nov 2004 09:13:17 -0800
- Subject: Re: [docbook-apps] Table head output in FO
- References: <20041102105731.88860.qmail@web54609.mail.yahoo.com>
In version 1.66.1, two new empty templates were added to help format tables.
The template named table.cell.properties is called just after each
<fo:table-cell> to allow you to add attributes on the element. And the
template named table.cell.block.properties is called just after the
<fo:block> inside the cell to put properties on the fo:block. So you could
use them like this:
<xsl:template name="table.cell.properties">
<xsl:choose>
<xsl:when test="ancestor::thead">
<xsl:attribute name="background-color">blue</xsl:attribute>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="table.cell.block.properties">
<!-- highlight text in table head -->
<xsl:if test="ancestor::thead">
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:if>
</xsl:template>
These two templates also permit you to implement table styles. The DocBook
table element takes a "tabstyle" attribute, where you can designate a table
style name. These templates could then check the @tabstyle value on the
table cell's ancestor table (or informaltable), and then base the properties
it adds on that setting using a larger "choose" statement.
Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net
----- Original Message -----
From: "Pirjo Tinat" <ptinat@yahoo.com>
To: <docbook-apps@lists.oasis-open.org>
Sent: Tuesday, November 02, 2004 2:57 AM
Subject: [docbook-apps] Table head output in FO
> Hi all,
>
> How can I control the table head's output in pdf? I would like to
> have all table/thead/rows with a background-color and all
> table/thead/row/entries with bold.
>
> In HTML this is obvious, but how about pdf (I'm using XEP)?
>
> In DocBook XSL: The Complete Guide it says that "Currently the row
> customization only works for HTML output". Does this mean that for
> now there is no solution beyond PIs?
>
> I do not want to use processing instructions, because I may want to
> change the layout later for all tables and I don't want to revisit
> all tables (in addition to the problems our system has with PIs, as I
> explained in a previous email).
>
>
> TIA,
>
> Pirjo :-)
>
> Pirjo Tinat
> Documentation Specialist
> Done Information Oy
>
>
>
>
>
> ___________________________________________________________ALL-NEW Yahoo!
Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
>
>