Long table

<!-- Long table that can't be fit into 1 page will be broken down to span across multiple pages -->
<!-- More info can be found at -->
<xsl:attribute-set name="">
  <xsl:attribute name="keep-together.within-column">auto</xsl:attribute>

Format table headers

<!-- Header rows have blue background and white character color-->
<xsl:template name="">
  <xsl:if test="ancestor::thead">
    <xsl:attribute name="font-weight">bold</xsl:attribute>
    <xsl:attribute name="color">#FFFFFF</xsl:attribute><!-- White -->
    <xsl:attribute name="background-color">#0000FF</xsl:attribute><!-- Blue -->
  <xsl:attribute name="text-align">left</xsl:attribute><!-- left, right, justify -->
<?xml version="1.0" encoding="UTF-8"?>
Description: Format table header
Date: 2008-01-17:
Author: Xuan Ngo
<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:fo="">
  <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
  <!-- Copy everything -->
  <!-- ############# -->
  <xsl:template match="@*|node()">
      <xsl:apply-templates select="@*|node()"/>
  <!-- Catching matching conditions -->
  <xsl:template match="thead/row">
    <xsl:element name="row">
      <xsl:processing-instruction name="dbhtml">bgcolor="#000000"</xsl:processing-instruction>
      <xsl:processing-instruction name="dbfo">bgcolor="#000000"</xsl:processing-instruction>
      <xsl:apply-templates select="@*|node()"/>

Column width

Add colspec tag inside your xml DocBook file.

<table><title>My table</title>
<tgroup cols="4" >
<colspec colnum="1" colname="col1" colwidth="1*"/>
<colspec colnum="2" colname="col2" colwidth="2*"/>
<colspec colnum="3" colname="col3" colwidth="1.5*"/>
<colspec colnum="4" colname="col4" colwidth="1*"/>

Here is how you specify column width values: colwidth specifies the desired width of the relevant column. It can be either a fixed measure using one of the CALS units (36pt, 10pc, etc.) or a proportional measure. Proportional measures have the form “number”, meaning this column should be number times wider than a column with the measure “1” (or just “”). These two forms can be mixed, as in “3+1pc”.