<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY __table-eg00__g468a1wg SYSTEM "table-eg00.xml">
<!ENTITY __table-eg01__g468a1wg SYSTEM "table-eg01.xml">
<!ENTITY __table-eg02__g468a1wh SYSTEM "table-eg02.xml">
<!ENTITY __table-style1 SYSTEM "table-style1.xml">
<!ENTITY __table-style2 SYSTEM "table-style2.xml">
]>
<section id="sec-table" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Creating Tables</title>

<para>DocBook tables can be quite complex, but <command>dblatex</command>
should be able to drive most of cases thanks to the excellent newtbl
implementation by David Hedley completely written in XSL.</para>

<para>Here is what is supported:</para>

<itemizedlist>
<listitem>
<para>Columns without specified widths (<sgmltag>colspec</sgmltag> without
<sgmltag>colwidth</sgmltag> attribute) have the same size.</para>
</listitem>

<listitem>
<para>A table width is always equal to the page width, if at least one column
doesn't contain a fixed width attribute (e.g. colwidth=“12cm”).</para>
</listitem>

<listitem>
<para>Fixed column widths are supported (e.g. colwidth=“10cm”). The unit can
be whatever is understood by latex (e.g. cm, em, in, pt).</para>
</listitem>

<listitem>
<para>Proportional column widths are supported (e.g. colwidth= “5*”).
Combination of fixed and proportional width is supported too (e.g.
colwidth=“5*+10cm”).</para>
</listitem>

<listitem>
<para>The <sgmltag>morerows</sgmltag> attribute of a table entry
(<sgmltag>entry</sgmltag> element) is supported.</para>
</listitem>

<listitem>
<para>The <sgmltag>namest</sgmltag> and <sgmltag>nameend</sgmltag> attributes
of a table entry (<sgmltag>entry</sgmltag> element) are supported. It is
possible to have a cell spanned on several columns.</para>
</listitem>

<listitem>
<para>The <sgmltag>orient</sgmltag> table attribute is supported (portrait and
landscape).</para>
</listitem>

<listitem>
<para>It is possible to have missing cell entries in a table.</para>
</listitem>
</itemizedlist>

<section>
<title>Limitations</title>

<para>Currently the following things are known to fail with tables:
<itemizedlist>
<listitem>
<para>Program listings and screens cannot be embedded in tables. Some other
verbatim environments like litterallayout are allowed.</para>
</listitem>
</itemizedlist><itemizedlist>
<listitem>
<para>Footnotes in table cells can fail, especially if the footnote contains
several paragraphs. Moreover they are lost is a float like a table.</para>
</listitem>
</itemizedlist></para>
</section>

<section id="sec-table-width">
<title>Table Width</title>

<para>A table width is explicit when all the columns have a fixed size. In
this case it is the sum of the colum widths. In the other cases (columns with
no colwidth or proportional columns widths) the total table width is deduced
by dblatex as follow: it looks for the Processing Instruction
<literal>&lt;?dblatex table-with="<replaceable>width</replaceable>"
?&gt;</literal> first, then the @width attribute, the
<parameter>default.table.width</parameter> parameter, and finally use the page
width.</para>

<para>A table width can be expressed as:</para>

<itemizedlist id="table-width-format">
<listitem>
<para>A valid length (e.g. 15cm),</para>
</listitem>

<listitem>
<para>A percentage of the page width (e.g. 75%),</para>
</listitem>

<listitem>
<para>A keyword telling to apply an automatic column width (e.g.
autowidth.all).</para>
</listitem>
</itemizedlist>

<para>The automatic column width setup is detailed in <xref linkend="sec-autowidth" />.</para>
</section>

<section>
<title>Tables without colwidth</title>

<para>When none of the <sgmltag>colspec</sgmltag> elements contains the
<sgmltag>colwidth</sgmltag> attribute, all the columns have the same size, and
the table width is fixed to the maximum available size. Several examples of
these tables are given<phrase output="html"> in the PDF version of this
manual</phrase>.</para>

<para output="pdf">
&__table-eg00__g468a1wg;

&__table-eg01__g468a1wg;

&__table-eg02__g468a1wh;
</para>
</section>

<section>
<title>Tables with mixed colspec</title>

<para>A table can have <sgmltag>colspec</sgmltag> elements containing
<sgmltag>colwidth</sgmltag> attribute mixed with <sgmltag>colspec</sgmltag>
elements without <sgmltag>colwidth</sgmltag>. Here is an XML source
example:</para>

<programlisting>
&lt;informaltable&gt;
  &lt;tgroup cols="5" colsep="1" rowsep="1" align="left"&gt;
    &lt;colspec colname="c1"/&gt;
    &lt;colspec align="left" colwidth="4cm"/&gt;
    &lt;colspec align="right" colwidth="5cm"/&gt;
    &lt;colspec align="center"/&gt;
    &lt;colspec align="center" colwidth="3cm"/&gt;
    &lt;tbody&gt;
    ...
    &lt;/tbody&gt;
  &lt;/tgroup&gt;
&lt;/informaltable&gt;
   </programlisting>

<para output="pdf">It is rendered like this: <xi:include href="table-eg1.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" /></para>

<para output="html">See the PDF version of this manual to see how it is
rendered.</para>
</section>

<section>
<title>Tables with proportional and fixed colwidth</title>

<para>Proportional column widths are supported. Here is an example:</para>

<programlisting>
&lt;informaltable&gt;
  &lt;tgroup cols="5" colsep="1" rowsep="1" align="left"&gt; 
    &lt;colspec colname="c1" colwidth="*"/&gt; 
    &lt;colspec align="left" colwidth="2*"/&gt; 
    &lt;colspec align="right" colwidth="3*"/&gt; 
    &lt;colspec align="center"/&gt;
    &lt;colspec align="center" colwidth="3cm"/&gt;
    &lt;tbody&gt;
    ...
    &lt;/tbody&gt;
  &lt;/tgroup&gt;
&lt;/informaltable&gt;
   </programlisting>

<para output="pdf">It gives this table: <xi:include href="table-eg2.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" /></para>
</section>

<section>
<title>Tables with fixed colwidths</title>

<para>All the columns can have fixed size, like this:</para>

<programlisting>&lt;informaltable&gt;
  &lt;tgroup cols="4" colsep="1" rowsep="1" align="left"&gt; 
    &lt;colspec colname="c1" colwidth="2cm"/&gt; 
    &lt;colspec align="left" colwidth="2.5cm"/&gt; 
    &lt;colspec align="right" colwidth="5cm"/&gt; 
    &lt;colspec align="center" colwidth="3cm"/&gt;
    &lt;tbody&gt;
    ...
    &lt;/tbody&gt;
  &lt;/tgroup&gt;
&lt;/informaltable&gt;
</programlisting>

<para output="pdf">It gives the following table: <xi:include
href="table-eg3.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /></para>
</section>

<section id="sec-autowidth">
<title>Automatic Column Width</title>

<section id="sec-newtbl-autowidth">
<title>Global Setting</title>

<para>In the previous sections the columns widths are computed from a
proportional basis, when no colwidth is specified or when the colwidths
contain a star ("*"). Of course, a colwidth containing a fixed width
incidently sets the column width with this size.</para>

<para>It is possible to change this sizing policy of not-fixed-width columns
by playing with the <parameter>newtbl.autowidth</parameter> parameter. The
parameter can take the following values:

<variablelist id="autowidth-items">
<varlistentry>
<term>default</term>

<listitem>
<para>The automatic width (that is, latex is in charge to size the column
width) is applied only to columns not having a specified
<sgmltag>colspec</sgmltag> colwidth. It includes both undefined
<sgmltag>colspec</sgmltag>, and <sgmltag>colspec</sgmltag> without the
colwidth attribute.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>all</term>

<listitem>
<para>the automatic width is applied to any column, whether a colspec is
provided or not.</para>
</listitem>
</varlistentry>
</variablelist></para>

<para>By default the parameter is unset, and no automatic width is applied.
Using automatic width is handy in some situations but there is no more control
if the tables fit in the page or not, since in this case the column is as wide
as its content, with no more paragraph breaking. The parameter is global for
all the tables in the document.</para>

<para>You can also perform the same thing by setting the
<parameter>default.table.width</parameter> parameter to
<literal>autowidth.default</literal> or <literal>autowidth.all</literal>
instead of using <parameter>newtbl.autowidth</parameter>.</para>
</section>

<section id="sec-newtbl-autowidth2">
<title>Local Setting</title>

<para id="pi-autowidth">If you want to apply an automatic width only to some
specific tables you can put the Processing Instruction <literal>&lt;?dblatex
table-with="autowidth.<replaceable>scope</replaceable>" ?&gt;</literal> in the
related tables. The PI has precedence over the
<parameter>newtbl.autowidth</parameter> parameter.</para>

<para>The <replaceable>scope</replaceable> can take the same values and have
the same effects than for the <parameter>newtbl.autowidth</parameter>
parameter (<literal>default</literal> or <literal>all</literal>).</para>

<para id="pi-autowidth-column">In addition to these keywords, <parameter>table.width</parameter> 
can also take for its value keywords of the form 
<literal>autowidth.column: <replaceable>N</replaceable><replaceable> ...</replaceable></literal>, where <replaceable>N</replaceable> is the number of the 
column (counting from 1) which is to have its width automatically sized.</para>

<para>See the following example:</para>

<para>
<programlisting id="lst-table-autowidth">&lt;informaltable&gt;<emphasis role="bold">&lt;?dblatex table-width="autowidth.column: 1 3"?&gt;</emphasis>
  &lt;tgroup cols="4" colsep="1" rowsep="1" align="left"&gt;
  &lt;colspec colname="c1"/&gt;                 &lt;!-- automatic width is applied to column #1 --&gt;
  &lt;colspec align="left" colwidth="*"/&gt;
  &lt;colspec align="right" colwidth="5cm"/&gt; &lt;!-- automatic width is applied to column #3 --&gt;
  &lt;colspec align="center" colwidth="3cm"/&gt;
  ...
&lt;/informaltable&gt;
</programlisting>
</para>

<para>Here are two other examples with the all and default scopes:</para>

<para>The following table has columns 1 and 2 sized by latex with
autowidth.all:</para>

<xi:include href="table-auto1.xml" />

<para>It is written as follow:</para>

<para>
<programlisting>&lt;informaltable&gt;<emphasis role="bold">&lt;?dblatex table-width="autowidth.all"?&gt;</emphasis>
  &lt;tgroup cols="4" colsep="1" rowsep="1" align="left"&gt;
  &lt;colspec colname="c1"/&gt; &lt;!-- 'default' and 'all' apply on this column --&gt;
  &lt;colspec align="left" colwidth="*"/&gt; &lt;!-- only 'all' applies on this column --&gt;
  &lt;colspec align="right" colwidth="5cm"/&gt;
  &lt;colspec align="center" colwidth="3cm"/&gt;
  ...
&lt;/informaltable&gt;
</programlisting>
</para>

<para>The following table has only columns 1 sized by latex with
autowidth.default:</para>

<xi:include href="table-auto2.xml" />

<para>The only difference is that the PI attribute value is
autowidth.default:</para>

<programlisting>&lt;informaltable&gt;<emphasis role="bold">&lt;?dblatex table-width="autowidth.default"?&gt;</emphasis>
  &lt;tgroup cols="4" colsep="1" rowsep="1" align="left"&gt;
  &lt;colspec colname="c1"/&gt; &lt;!-- 'default' and 'all' apply on this column --&gt;
  &lt;colspec align="left" colwidth="*"/&gt; &lt;!-- only 'all' applies on this column --&gt;
  &lt;colspec align="right" colwidth="5cm"/&gt;
  &lt;colspec align="center" colwidth="3cm"/&gt;
  ...
&lt;/informaltable&gt;
</programlisting>
</section>
</section>

<section id="sec-tabstyle">
<title>Informal Table LaTeX Styles</title>

<para>By default <command>dblatex</command> translates an informal table to
the LaTeX environment specified by the
<parameter>table.default.tabstyle</parameter> parameter (usually
<literal>longtable</literal>), but you can specify which Latex tabular
environment to use, globally through the parameter, or per table through the
<sgmltag>tabstyle</sgmltag> attribute. Of course the
<sgmltag>tabstyle</sgmltag> attribute value is specific to dblatex. The
supported values are:</para>

<para>
<variablelist>
<varlistentry>
<term>longtable</term>

<listitem>
<para>The default table type used by dblatex when
<parameter>table.default.tabstyle</parameter> is empty, in order to be able to
split over several pages.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>tabular</term>

<listitem>
<para>The most usual table type. Such table can only be on a single
page.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>tabularx</term>

<listitem>
<para>An advanced table type that allows to stretch column widths to the
available remained page width. Such table can only be on a single page like
for "tabular".</para>
</listitem>
</varlistentry>
</variablelist>
</para>

<para>The two following examples show how tabular and tabularx rendering
differ when the automatic width feature is used. Here is the XML source
code:</para>

<programlisting>&lt;informaltable tabstyle="<emphasis role="bold">tabular</emphasis>"&gt;
  &lt;?dblatex table-width="autowitdh.column: 1 3"?&gt;
  &lt;tgroup cols="5" colsep="1" rowsep="1" align="left"&gt; 
    &lt;colspec colname="c1"/&gt;
    &lt;colspec align="left"/&gt;
    &lt;colspec align="right"/&gt;
    &lt;colspec align="center"/&gt;
    ...
  &lt;/tgroup&gt;
&lt;/informaltable&gt;

&lt;informaltable tabstyle="<emphasis role="bold">tabularx</emphasis>"&gt;
  &lt;?dblatex table-width="autowitdh.column: 1 3"?&gt;
  &lt;tgroup cols="5" colsep="1" rowsep="1" align="left"&gt; 
    &lt;colspec colname="c1"/&gt;
    &lt;colspec align="left"/&gt;
    &lt;colspec align="right"/&gt;
    &lt;colspec align="center"/&gt;
    ...
  &lt;/tgroup&gt;
&lt;/informaltable&gt;
</programlisting>

<para>It is rendered as follow:</para>

<para output="pdf">
&__table-style1;

&__table-style2;
</para>
</section>

<section>
<title>Tables with morerows</title>

<para>A table can contain entries that cover several lines. The following XML
source contains an entry covering 4 lines:</para>

<programlisting>&lt;informaltable&gt;
  &lt;tgroup cols="4" colsep="1" rowsep="1" align="left"&gt; 
    &lt;colspec colname="c1" colwidth="*"/&gt;
    ...
    &lt;tbody&gt;
    &lt;entry morerows="3"&gt;it covers 4 lines&lt;/entry&gt;
    ...
    &lt;/tbody&gt;
  &lt;/tgroup&gt;
&lt;/informaltable&gt;
</programlisting>

<para output="pdf">Here is an example of table containing several entries with
morerows attribute: <xi:include href="table-eg4.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" /></para>
</section>

<section>
<title>Landscape tables</title>

<para>A table can be displayed in a lanscape format by using the
<sgmltag>orient</sgmltag> attribute. Here is an XML source example:</para>

<programlisting>&lt;informaltable orient="land"&gt;
  &lt;tgroup cols="5" colsep="1" rowsep="1" align="left"&gt; 
    &lt;colspec colname="c1" colwidth="*"/&gt;
    ...
    &lt;tbody&gt;
    ...
    &lt;/tbody&gt;
  &lt;/tgroup&gt;
&lt;/informaltable&gt;
</programlisting>

<para output="pdf">Here is how it is displayed. <xi:include
href="table-land.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /></para>
</section>

<section>
<title>Smaller tables</title>

<para>For big tables it can be usefull to have smaller text, so that the table
is not too large or too long and it can be displayed within a page. It is
possible to specify smaller table text by using the <sgmltag>role</sgmltag>
attribute of the elements <sgmltag>table</sgmltag> or
<sgmltag>informaltable</sgmltag>.</para>

<para>The values and the “role” dedicated to this attribute are specific to
dblatex, but it is compliant with the DocBook specification because in general
the <sgmltag>role</sgmltag> attribute purpose is never defined.</para>

<para>The available text size definitions supported by <sgmltag>role</sgmltag>
are directly taken from LaTeX:</para>

<itemizedlist>
<listitem>
<para>small,</para>
</listitem>

<listitem>
<para>footnotesize,</para>
</listitem>

<listitem>
<para>scriptsize,</para>
</listitem>

<listitem>
<para>tiny.</para>
</listitem>
</itemizedlist>

<para output="pdf">Here are examples for each size. <xi:include
href="table-small1.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="table-small2.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" /> <xi:include
href="table-small3.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="table-small4.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" /></para>
</section>

<section id="sec-table-color">
<title>Coloured tables</title>

<para>You can color all the table by setting its <sgmltag>bgcolor</sgmltag>
attribute.</para>

<para>You can also color only some cells by using the Processing Instruction
<literal>&lt;?dblatex bgcolor="color"?&gt;</literal>. The PI can apply to
columns when put in a <sgmltag>colspec</sgmltag>, to rows when put at the
beginning of a <sgmltag>row</sgmltag>, or to cells when put in a
<sgmltag>entry</sgmltag>.</para>

<para>The entry colour has precedence over the row colour, that has precedence
over the column colour, that has precedence over the table colour.</para>

<para id="table-color-format">The color can be expressed in hexadecimal
notation like for HTML (e.g. <literal>#C0C0C0</literal>) or in a syntax
understood by the <filename>colortbl</filename> latex package.</para>

<para>Here is a<phrase output="pdf">n</phrase><phrase output="html"> PDF
output</phrase> example.</para>

<para output="pdf">
<xi:include href="coloured.xml" />
</para>

<!-- The image img-tbl-color.png was built with the command line:
     ../tools/imagefrom manual.xml tbl-color 
-->

<mediaobject output="html">
<imageobject>
<imagedata align="center" fileref="img-tbl-color" />
</imageobject>
</mediaobject>

<para>This table is coded like this:</para>

<!-- To comment before editing with XXE
-->
<programlisting><xi:include href="coloured.xml" parse="text"/></programlisting>
</section>

<section id="sec-html-table">
<title>HTML Tables</title>

<para>Since version 0.3.2 dblatex supports HTML tables. Some features are
handled differently from CALS tables as illustrated by the following HTML
table source example:</para>

<programlisting language="HTML">&lt;table border="1" width="100%" rules="all"<co
id="co-htmltbl-rules" />&gt;
  &lt;caption&gt;An HTML Table&lt;/caption&gt;<co id="co-htmltbl-title" />
  &lt;colgroup span="2" valign="top" align="right"/&gt;
    &lt;?dblatex bgcolor="red"?&gt;<co id="co-htmltbl-bgcolor1" />
  &lt;/colgroup&gt;
  &lt;colgroup valign="bottom" align="left" width="5%"<co
id="co-htmltbl-widthpct" />&gt;
    &lt;col align="right" span="2"/&gt;
    &lt;col valign="top"/&gt;
  &lt;/colgroup&gt;
  &lt;colgroup bgcolor="yellow" width="0*"<co id="co-htmltbl-autowidth" />&gt;&lt;?dblatex bgcolor="yellow"?&gt;&lt;/colgroup&gt;
  &lt;colgroup valign="bottom" align="left" width="15%"/&gt;
  &lt;colgroup valign="bottom" align="left" width="10%"/&gt;
  &lt;thead&gt;
    &lt;tr&gt; &lt;td width="10%"&gt;Head A1&lt;/td&gt;&lt;td&gt;Head B1&lt;/td&gt;&lt;td&gt;Head C1&lt;/td&gt; &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tfoot&gt;
    &lt;tr&gt; &lt;td width="10%"&gt;Foot A1&lt;/td&gt;&lt;td&gt;Foot B1&lt;/td&gt;&lt;td&gt;Foot C1&lt;/td&gt; &lt;/tr&gt;
  &lt;/tfoot&gt;

  &lt;tr&gt;
    &lt;td width="10%"&gt;A1&lt;/td&gt;&lt;td&gt;B1&lt;/td&gt;&lt;td&gt;C1&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;A2&lt;/td&gt;&lt;td bgcolor="yellow"&gt;B2&lt;/td&gt;&lt;td colspan="3" rowspan="3"&gt;C-E2&lt;/td&gt;&lt;td&gt;F2&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;A3&lt;/td&gt;&lt;td width="25.3"<co id="co-htmltbl-widthfix" />&gt;B3&lt;/td&gt;&lt;td&gt;F3&lt;/td&gt;&lt;td rowspan="2"&gt;G3&lt;/td&gt;&lt;td rowspan="3"&gt;H3&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;A4&lt;/td&gt;&lt;td&gt;B4&lt;/td&gt;&lt;td&gt;F4&lt;/td&gt;&lt;td&gt;G4&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;A5&lt;/td&gt;&lt;td&gt;B5&lt;/td&gt;&lt;td width="5%"&gt;C5&lt;/td&gt;&lt;td&gt;D5&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr bgcolor="blue"<co id="co-htmltbl-bgcolorp" />&gt;
    &lt;td&gt;A6&lt;/td&gt;&lt;td&gt;B6&lt;/td&gt;&lt;td&gt;C6&lt;/td&gt;&lt;td&gt;D6&lt;/td&gt;&lt;td&gt;E6&lt;/td&gt;&lt;td bgcolor="green"<coref
linkend="co-htmltbl-bgcolorp" />&gt;F6&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;</programlisting>

<calloutlist>
<callout arearefs="co-htmltbl-rules">
<para>The cell borders are specified through the table <sgmltag
role="attribute">rules</sgmltag> attribute, and not by any
<sgmltag>rowsep</sgmltag> and <sgmltag>colsep</sgmltag> attributes. Therefore
it is not possible to set the borders of an individual cell. If no <sgmltag
role="attribute">rules</sgmltag> attribute is provided the default setup
defined by <parameter>default.table.rules</parameter> parameter is
used.</para>
</callout>

<callout arearefs="co-htmltbl-title">
<para>The title of a formal HTML table is set through the
<sgmltag>caption</sgmltag> element, because the <sgmltag>title</sgmltag>
element is not available.</para>
</callout>

<callout arearefs="co-htmltbl-bgcolor1">
<para>The cell background colors can be set directly with the bgcolor
attribute in <sgmltag>row</sgmltag> (for an entire row color setting),
<sgmltag>th</sgmltag>, or <sgmltag>td</sgmltag>, but the dblatex bgcolor
Processing Instruction is required in <sgmltag>colgroup</sgmltag> or
<sgmltag>col</sgmltag> to set a column color.</para>
</callout>

<callout arearefs="co-htmltbl-widthpct">
<para>The relative widths can be expressed as a percentage. The proportional
syntax (e.g. "3*") is still available in <sgmltag>colgroup</sgmltag>s.</para>
</callout>

<callout arearefs="co-htmltbl-autowidth">
<para>To specify that a column must be as wide as its content, there is no
need to use the dblatex autowidth Processing Instruction. You just need to set
the related colgroup width attribute to "0*".</para>
</callout>

<callout arearefs="co-htmltbl-widthfix">
<para>The fixed widths must be expressed as numbers, and the implicit unit is
the point ("pt"). You cannot set a width expressed in a unit like inchs
("in"), centimeters ("cm") and so on.</para>
</callout>

<callout arearefs="co-htmltbl-bgcolorp">
<para>The closest enclosing element attribute has precedence over ancestor
attributes. This applies to background color too.</para>
</callout>
</calloutlist>

<para>This source example is rendered as follow:</para>

<para output="pdf">
<xi:include href="table-html.xml" />
</para>

<!-- The image img-tbl-html.png was built with the command line:
     ../tools/imagefrom manual.xml tbl-html 
-->

<mediaobject output="html">
<imageobject>
<imagedata align="center" fileref="img-tbl-html" />
</imageobject>
</mediaobject>
</section>
</section>
