6
DocBook tables can be quite complex, but dblatex should be able to drive most of
9
The tool contains two engines to create tables: the excellent newtbl implementation
10
by David Hedley completely written in XSL, and a (obsolete) perl parser.
11
One can select the engine to use with the parameter <varname>newtbl.use</varname>.
12
By default the newtbl engine is used, and the perl parser will be dropped one
15
Here is what is supported:
20
Columns without specified widths (<sgmltag>colspec</sgmltag> without <sgmltag>colwidth</sgmltag> attribute) have the same size.
25
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”).
30
Fixed column widths are supported (e.g. colwidth=“10cm”). The
31
unit can be whatever is understood by latex (e.g. cm, em, in, pt).
36
Proportional column widths are supported (e.g. colwidth= “5*”).
37
Combination of fixed and proportional width is supported too
38
(e.g. colwidth=“5*+10cm”).
43
The <sgmltag>morerows</sgmltag> attribute of a table entry (<sgmltag>entry</sgmltag> element) is supported.
48
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.
53
The <sgmltag>orient</sgmltag> table attribute is supported (portrait and landscape).
58
It is possible to have missing cell entries in a table.
62
<sect2> <title> Limitations </title>
63
<para>Currently the following things are known to fail with tables:
65
<listitem><para>Verbatim text in table cells is not
66
possible.</para></listitem>
67
<listitem><para>Footnotes in table cells can fail, especially if the footnote
68
contains several paragraph. Moreover they are lost is a float like a table.
75
Tables without colwidth
78
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.
86
Tables with mixed colspec
89
A table can have <sgmltag>colspec</sgmltag> elements containing <sgmltag>colwidth</sgmltag> attribute mixed with <sgmltag>colspec</sgmltag> elements without <sgmltag>colwidth</sgmltag>. The following XML source:
92
<![CDATA[<informaltable>
93
<tgroup cols="5" colsep="1" rowsep="1" align="left">
94
<colspec colname="c1"/>
95
<colspec align="left" colwidth="4cm"/>
96
<colspec align="right" colwidth="5cm"/>
97
<colspec align="center"/>
98
<colspec align="center" colwidth="3cm"/>
104
]]> </programlisting>
106
is rendered like this:
112
Tables with proportional and fixed colwidth
115
Proportional column widths are supported. The following XML source:
118
<![CDATA[<informaltable>
119
<tgroup cols="5" colsep="1" rowsep="1" align="left">
120
<colspec colname="c1" colwidth="*"/>
121
<colspec align="left" colwidth="2*"/>
122
<colspec align="right" colwidth="3*"/>
123
<colspec align="center"/>
124
<colspec align="center" colwidth="3cm"/>
130
]]> </programlisting>
138
Tables with fixed colwidths
141
All the columns can have fixed size, like this:
144
<![CDATA[<informaltable>
145
<tgroup cols="4" colsep="1" rowsep="1" align="left">
146
<colspec colname="c1" colwidth="2cm"/>
147
<colspec align="left" colwidth="2.5cm"/>
148
<colspec align="right" colwidth="5cm"/>
149
<colspec align="center" colwidth="3cm"/>
155
]]> </programlisting>
157
It gives the following table:
166
A table can contain entries that cover several lines. The following XML source contains an entry covering 4 lines:
169
<![CDATA[<informaltable>
170
<tgroup cols="4" colsep="1" rowsep="1" align="left">
171
<colspec colname="c1" colwidth="*"/>
174
<entry morerows="3">it covers 4 lines</entry>
179
]]> </programlisting>
181
Here is an example of table containing several entries with morerows attribute:
190
A table can be displayed in a lanscape format by using the <sgmltag>orient</sgmltag> attribute. The following XML source is an example.
193
<![CDATA[<informaltable orient="land">
194
<tgroup cols="5" colsep="1" rowsep="1" align="left">
195
<colspec colname="c1" colwidth="*"/>
202
]]> </programlisting>
204
Here is how it is displayed.
213
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>.
216
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.
219
The available text size definitions supported by <sgmltag>role</sgmltag> are directly taken from LaTeX:
244
Here are examples for each size.