Debian Codegraph @

docs/tables/table.xml

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 <!ENTITY __table-eg00__g468a1wg SYSTEM "table-eg00.xml">
5 <!ENTITY __table-eg01__g468a1wg SYSTEM "table-eg01.xml">
6 <!ENTITY __table-eg02__g468a1wh SYSTEM "table-eg02.xml">
7 <!ENTITY __table-style1 SYSTEM "table-style1.xml">
8 <!ENTITY __table-style2 SYSTEM "table-style2.xml">
9 ]>
10 <section id="sec-table" xmlns:xi="http://www.w3.org/2001/XInclude">
11 <title>Creating Tables</title>
12
13 <para>DocBook tables can be quite complex, but <command>dblatex</command>
14 should be able to drive most of cases thanks to the excellent newtbl
15 implementation by David Hedley completely written in XSL.</para>
16
17 <para>Here is what is supported:</para>
18
19 <itemizedlist>
20 <listitem>
21 <para>Columns without specified widths (<sgmltag>colspec</sgmltag> without
22 <sgmltag>colwidth</sgmltag> attribute) have the same size.</para>
23 </listitem>
24
25 <listitem>
26 <para>A table width is always equal to the page width, if at least one column
27 doesn't contain a fixed width attribute (e.g. colwidth=“12cm”).</para>
28 </listitem>
29
30 <listitem>
31 <para>Fixed column widths are supported (e.g. colwidth=“10cm”). The unit can
32 be whatever is understood by latex (e.g. cm, em, in, pt).</para>
33 </listitem>
34
35 <listitem>
36 <para>Proportional column widths are supported (e.g. colwidth= “5*”).
37 Combination of fixed and proportional width is supported too (e.g.
38 colwidth=“5*+10cm”).</para>
39 </listitem>
40
41 <listitem>
42 <para>The <sgmltag>morerows</sgmltag> attribute of a table entry
43 (<sgmltag>entry</sgmltag> element) is supported.</para>
44 </listitem>
45
46 <listitem>
47 <para>The <sgmltag>namest</sgmltag> and <sgmltag>nameend</sgmltag> attributes
48 of a table entry (<sgmltag>entry</sgmltag> element) are supported. It is
49 possible to have a cell spanned on several columns.</para>
50 </listitem>
51
52 <listitem>
53 <para>The <sgmltag>orient</sgmltag> table attribute is supported (portrait and
54 landscape).</para>
55 </listitem>
56
57 <listitem>
58 <para>It is possible to have missing cell entries in a table.</para>
59 </listitem>
60 </itemizedlist>
61
62 <section>
63 <title>Limitations</title>
64
65 <para>Currently the following things are known to fail with tables:
66 <itemizedlist>
67 <listitem>
68 <para>Program listings and screens cannot be embedded in tables. Some other
69 verbatim environments like litterallayout are allowed.</para>
70 </listitem>
71 </itemizedlist><itemizedlist>
72 <listitem>
73 <para>Footnotes in table cells can fail, especially if the footnote contains
74 several paragraphs. Moreover they are lost is a float like a table.</para>
75 </listitem>
76 </itemizedlist></para>
77 </section>
78
79 <section id="sec-table-width">
80 <title>Table Width</title>
81
82 <para>A table width is explicit when all the columns have a fixed size. In
83 this case it is the sum of the colum widths. In the other cases (columns with
84 no colwidth or proportional columns widths) the total table width is deduced
85 by dblatex as follow: it looks for the Processing Instruction
86 <literal>&lt;?dblatex table-with="<replaceable>width</replaceable>"
87 ?&gt;</literal> first, then the @width attribute, the
88 <parameter>default.table.width</parameter> parameter, and finally use the page
89 width.</para>
90
91 <para>A table width can be expressed as:</para>
92
93 <itemizedlist id="table-width-format">
94 <listitem>
95 <para>A valid length (e.g. 15cm),</para>
96 </listitem>
97
98 <listitem>
99 <para>A percentage of the page width (e.g. 75%),</para>
100 </listitem>
101
102 <listitem>
103 <para>A keyword telling to apply an automatic column width (e.g.
104 autowidth.all).</para>
105 </listitem>
106 </itemizedlist>
107
108 <para>The automatic column width setup is detailed in <xref linkend="sec-autowidth" />.</para>
109 </section>
110
111 <section>
112 <title>Tables without colwidth</title>
113
114 <para>When none of the <sgmltag>colspec</sgmltag> elements contains the
115 <sgmltag>colwidth</sgmltag> attribute, all the columns have the same size, and
116 the table width is fixed to the maximum available size. Several examples of
117 these tables are given<phrase output="html"> in the PDF version of this
118 manual</phrase>.</para>
119
120 <para output="pdf">
121 &__table-eg00__g468a1wg;
122
123 &__table-eg01__g468a1wg;
124
125 &__table-eg02__g468a1wh;
126 </para>
127 </section>
128
129 <section>
130 <title>Tables with mixed colspec</title>
131
132 <para>A table can have <sgmltag>colspec</sgmltag> elements containing
133 <sgmltag>colwidth</sgmltag> attribute mixed with <sgmltag>colspec</sgmltag>
134 elements without <sgmltag>colwidth</sgmltag>. Here is an XML source
135 example:</para>
136
137 <programlisting>
138 &lt;informaltable&gt;
139 &lt;tgroup cols="5" colsep="1" rowsep="1" align="left"&gt;
140 &lt;colspec colname="c1"/&gt;
141 &lt;colspec align="left" colwidth="4cm"/&gt;
142 &lt;colspec align="right" colwidth="5cm"/&gt;
143 &lt;colspec align="center"/&gt;
144 &lt;colspec align="center" colwidth="3cm"/&gt;
145 &lt;tbody&gt;
146 ...
147 &lt;/tbody&gt;
148 &lt;/tgroup&gt;
149 &lt;/informaltable&gt;
150 </programlisting>
151
152 <para output="pdf">It is rendered like this: <xi:include href="table-eg1.xml"
153 xmlns:xi="http://www.w3.org/2001/XInclude" /></para>
154
155 <para output="html">See the PDF version of this manual to see how it is
156 rendered.</para>
157 </section>
158
159 <section>
160 <title>Tables with proportional and fixed colwidth</title>
161
162 <para>Proportional column widths are supported. Here is an example:</para>
163
164 <programlisting>
165 &lt;informaltable&gt;
166 &lt;tgroup cols="5" colsep="1" rowsep="1" align="left"&gt;
167 &lt;colspec colname="c1" colwidth="*"/&gt;
168 &lt;colspec align="left" colwidth="2*"/&gt;
169 &lt;colspec align="right" colwidth="3*"/&gt;
170 &lt;colspec align="center"/&gt;
171 &lt;colspec align="center" colwidth="3cm"/&gt;
172 &lt;tbody&gt;
173 ...
174 &lt;/tbody&gt;
175 &lt;/tgroup&gt;
176 &lt;/informaltable&gt;
177 </programlisting>
178
179 <para output="pdf">It gives this table: <xi:include href="table-eg2.xml"
180 xmlns:xi="http://www.w3.org/2001/XInclude" /></para>
181 </section>
182
183 <section>
184 <title>Tables with fixed colwidths</title>
185
186 <para>All the columns can have fixed size, like this:</para>
187
188 <programlisting>&lt;informaltable&gt;
189 &lt;tgroup cols="4" colsep="1" rowsep="1" align="left"&gt;
190 &lt;colspec colname="c1" colwidth="2cm"/&gt;
191 &lt;colspec align="left" colwidth="2.5cm"/&gt;
192 &lt;colspec align="right" colwidth="5cm"/&gt;
193 &lt;colspec align="center" colwidth="3cm"/&gt;
194 &lt;tbody&gt;
195 ...
196 &lt;/tbody&gt;
197 &lt;/tgroup&gt;
198 &lt;/informaltable&gt;
199 </programlisting>
200
201 <para output="pdf">It gives the following table: <xi:include
202 href="table-eg3.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /></para>
203 </section>
204
205 <section id="sec-autowidth">
206 <title>Automatic Column Width</title>
207
208 <section id="sec-newtbl-autowidth">
209 <title>Global Setting</title>
210
211 <para>In the previous sections the columns widths are computed from a
212 proportional basis, when no colwidth is specified or when the colwidths
213 contain a star ("*"). Of course, a colwidth containing a fixed width
214 incidently sets the column width with this size.</para>
215
216 <para>It is possible to change this sizing policy of not-fixed-width columns
217 by playing with the <parameter>newtbl.autowidth</parameter> parameter. The
218 parameter can take the following values:
219
220 <variablelist id="autowidth-items">
221 <varlistentry>
222 <term>default</term>
223
224 <listitem>
225 <para>The automatic width (that is, latex is in charge to size the column
226 width) is applied only to columns not having a specified
227 <sgmltag>colspec</sgmltag> colwidth. It includes both undefined
228 <sgmltag>colspec</sgmltag>, and <sgmltag>colspec</sgmltag> without the
229 colwidth attribute.</para>
230 </listitem>
231 </varlistentry>
232
233 <varlistentry>
234 <term>all</term>
235
236 <listitem>
237 <para>the automatic width is applied to any column, whether a colspec is
238 provided or not.</para>
239 </listitem>
240 </varlistentry>
241 </variablelist></para>
242
243 <para>By default the parameter is unset, and no automatic width is applied.
244 Using automatic width is handy in some situations but there is no more control
245 if the tables fit in the page or not, since in this case the column is as wide
246 as its content, with no more paragraph breaking. The parameter is global for
247 all the tables in the document.</para>
248
249 <para>You can also perform the same thing by setting the
250 <parameter>default.table.width</parameter> parameter to
251 <literal>autowidth.default</literal> or <literal>autowidth.all</literal>
252 instead of using <parameter>newtbl.autowidth</parameter>.</para>
253 </section>
254
255 <section id="sec-newtbl-autowidth2">
256 <title>Local Setting</title>
257
258 <para id="pi-autowidth">If you want to apply an automatic width only to some
259 specific tables you can put the Processing Instruction <literal>&lt;?dblatex
260 table-with="autowidth.<replaceable>scope</replaceable>" ?&gt;</literal> in the
261 related tables. The PI has precedence over the
262 <parameter>newtbl.autowidth</parameter> parameter.</para>
263
264 <para>The <replaceable>scope</replaceable> can take the same values and have
265 the same effects than for the <parameter>newtbl.autowidth</parameter>
266 parameter (<literal>default</literal> or <literal>all</literal>).</para>
267
268 <para id="pi-autowidth-column">In addition to these keywords, <parameter>table.width</parameter>
269 can also take for its value keywords of the form
270 <literal>autowidth.column: <replaceable>N</replaceable><replaceable> ...</replaceable></literal>, where <replaceable>N</replaceable> is the number of the
271 column (counting from 1) which is to have its width automatically sized.</para>
272
273 <para>See the following example:</para>
274
275 <para>
276 <programlisting id="lst-table-autowidth">&lt;informaltable&gt;<emphasis role="bold">&lt;?dblatex table-width="autowidth.column: 1 3"?&gt;</emphasis>
277 &lt;tgroup cols="4" colsep="1" rowsep="1" align="left"&gt;
278 &lt;colspec colname="c1"/&gt; &lt;!-- automatic width is applied to column #1 --&gt;
279 &lt;colspec align="left" colwidth="*"/&gt;
280 &lt;colspec align="right" colwidth="5cm"/&gt; &lt;!-- automatic width is applied to column #3 --&gt;
281 &lt;colspec align="center" colwidth="3cm"/&gt;
282 ...
283 &lt;/informaltable&gt;
284 </programlisting>
285 </para>
286
287 <para>Here are two other examples with the all and default scopes:</para>
288
289 <para>The following table has columns 1 and 2 sized by latex with
290 autowidth.all:</para>
291
292 <xi:include href="table-auto1.xml" />
293
294 <para>It is written as follow:</para>
295
296 <para>
297 <programlisting>&lt;informaltable&gt;<emphasis role="bold">&lt;?dblatex table-width="autowidth.all"?&gt;</emphasis>
298 &lt;tgroup cols="4" colsep="1" rowsep="1" align="left"&gt;
299 &lt;colspec colname="c1"/&gt; &lt;!-- 'default' and 'all' apply on this column --&gt;
300 &lt;colspec align="left" colwidth="*"/&gt; &lt;!-- only 'all' applies on this column --&gt;
301 &lt;colspec align="right" colwidth="5cm"/&gt;
302 &lt;colspec align="center" colwidth="3cm"/&gt;
303 ...
304 &lt;/informaltable&gt;
305 </programlisting>
306 </para>
307
308 <para>The following table has only columns 1 sized by latex with
309 autowidth.default:</para>
310
311 <xi:include href="table-auto2.xml" />
312
313 <para>The only difference is that the PI attribute value is
314 autowidth.default:</para>
315
316 <programlisting>&lt;informaltable&gt;<emphasis role="bold">&lt;?dblatex table-width="autowidth.default"?&gt;</emphasis>
317 &lt;tgroup cols="4" colsep="1" rowsep="1" align="left"&gt;
318 &lt;colspec colname="c1"/&gt; &lt;!-- 'default' and 'all' apply on this column --&gt;
319 &lt;colspec align="left" colwidth="*"/&gt; &lt;!-- only 'all' applies on this column --&gt;
320 &lt;colspec align="right" colwidth="5cm"/&gt;
321 &lt;colspec align="center" colwidth="3cm"/&gt;
322 ...
323 &lt;/informaltable&gt;
324 </programlisting>
325 </section>
326 </section>
327
328 <section id="sec-tabstyle">
329 <title>Informal Table LaTeX Styles</title>
330
331 <para>By default <command>dblatex</command> translates an informal table to
332 the LaTeX environment specified by the
333 <parameter>table.default.tabstyle</parameter> parameter (usually
334 <literal>longtable</literal>), but you can specify which Latex tabular
335 environment to use, globally through the parameter, or per table through the
336 <sgmltag>tabstyle</sgmltag> attribute. Of course the
337 <sgmltag>tabstyle</sgmltag> attribute value is specific to dblatex. The
338 supported values are:</para>
339
340 <para>
341 <variablelist>
342 <varlistentry>
343 <term>longtable</term>
344
345 <listitem>
346 <para>The default table type used by dblatex when
347 <parameter>table.default.tabstyle</parameter> is empty, in order to be able to
348 split over several pages.</para>
349 </listitem>
350 </varlistentry>
351
352 <varlistentry>
353 <term>tabular</term>
354
355 <listitem>
356 <para>The most usual table type. Such table can only be on a single
357 page.</para>
358 </listitem>
359 </varlistentry>
360
361 <varlistentry>
362 <term>tabularx</term>
363
364 <listitem>
365 <para>An advanced table type that allows to stretch column widths to the
366 available remained page width. Such table can only be on a single page like
367 for "tabular".</para>
368 </listitem>
369 </varlistentry>
370 </variablelist>
371 </para>
372
373 <para>The two following examples show how tabular and tabularx rendering
374 differ when the automatic width feature is used. Here is the XML source
375 code:</para>
376
377 <programlisting>&lt;informaltable tabstyle="<emphasis role="bold">tabular</emphasis>"&gt;
378 &lt;?dblatex table-width="autowitdh.column: 1 3"?&gt;
379 &lt;tgroup cols="5" colsep="1" rowsep="1" align="left"&gt;
380 &lt;colspec colname="c1"/&gt;
381 &lt;colspec align="left"/&gt;
382 &lt;colspec align="right"/&gt;
383 &lt;colspec align="center"/&gt;
384 ...
385 &lt;/tgroup&gt;
386 &lt;/informaltable&gt;
387
388 &lt;informaltable tabstyle="<emphasis role="bold">tabularx</emphasis>"&gt;
389 &lt;?dblatex table-width="autowitdh.column: 1 3"?&gt;
390 &lt;tgroup cols="5" colsep="1" rowsep="1" align="left"&gt;
391 &lt;colspec colname="c1"/&gt;
392 &lt;colspec align="left"/&gt;
393 &lt;colspec align="right"/&gt;
394 &lt;colspec align="center"/&gt;
395 ...
396 &lt;/tgroup&gt;
397 &lt;/informaltable&gt;
398 </programlisting>
399
400 <para>It is rendered as follow:</para>
401
402 <para output="pdf">
403 &__table-style1;
404
405 &__table-style2;
406 </para>
407 </section>
408
409 <section>
410 <title>Tables with morerows</title>
411
412 <para>A table can contain entries that cover several lines. The following XML
413 source contains an entry covering 4 lines:</para>
414
415 <programlisting>&lt;informaltable&gt;
416 &lt;tgroup cols="4" colsep="1" rowsep="1" align="left"&gt;
417 &lt;colspec colname="c1" colwidth="*"/&gt;
418 ...
419 &lt;tbody&gt;
420 &lt;entry morerows="3"&gt;it covers 4 lines&lt;/entry&gt;
421 ...
422 &lt;/tbody&gt;
423 &lt;/tgroup&gt;
424 &lt;/informaltable&gt;
425 </programlisting>
426
427 <para output="pdf">Here is an example of table containing several entries with
428 morerows attribute: <xi:include href="table-eg4.xml"
429 xmlns:xi="http://www.w3.org/2001/XInclude" /></para>
430 </section>
431
432 <section>
433 <title>Landscape tables</title>
434
435 <para>A table can be displayed in a lanscape format by using the
436 <sgmltag>orient</sgmltag> attribute. Here is an XML source example:</para>
437
438 <programlisting>&lt;informaltable orient="land"&gt;
439 &lt;tgroup cols="5" colsep="1" rowsep="1" align="left"&gt;
440 &lt;colspec colname="c1" colwidth="*"/&gt;
441 ...
442 &lt;tbody&gt;
443 ...
444 &lt;/tbody&gt;
445 &lt;/tgroup&gt;
446 &lt;/informaltable&gt;
447 </programlisting>
448
449 <para output="pdf">Here is how it is displayed. <xi:include
450 href="table-land.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /></para>
451 </section>
452
453 <section>
454 <title>Smaller tables</title>
455
456 <para>For big tables it can be usefull to have smaller text, so that the table
457 is not too large or too long and it can be displayed within a page. It is
458 possible to specify smaller table text by using the <sgmltag>role</sgmltag>
459 attribute of the elements <sgmltag>table</sgmltag> or
460 <sgmltag>informaltable</sgmltag>.</para>
461
462 <para>The values and the “role” dedicated to this attribute are specific to
463 dblatex, but it is compliant with the DocBook specification because in general
464 the <sgmltag>role</sgmltag> attribute purpose is never defined.</para>
465
466 <para>The available text size definitions supported by <sgmltag>role</sgmltag>
467 are directly taken from LaTeX:</para>
468
469 <itemizedlist>
470 <listitem>
471 <para>small,</para>
472 </listitem>
473
474 <listitem>
475 <para>footnotesize,</para>
476 </listitem>
477
478 <listitem>
479 <para>scriptsize,</para>
480 </listitem>
481
482 <listitem>
483 <para>tiny.</para>
484 </listitem>
485 </itemizedlist>
486
487 <para output="pdf">Here are examples for each size. <xi:include
488 href="table-small1.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
489 <xi:include href="table-small2.xml"
490 xmlns:xi="http://www.w3.org/2001/XInclude" /> <xi:include
491 href="table-small3.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
492 <xi:include href="table-small4.xml"
493 xmlns:xi="http://www.w3.org/2001/XInclude" /></para>
494 </section>
495
496 <section id="sec-table-color">
497 <title>Coloured tables</title>
498
499 <para>You can color all the table by setting its <sgmltag>bgcolor</sgmltag>
500 attribute.</para>
501
502 <para>You can also color only some cells by using the Processing Instruction
503 <literal>&lt;?dblatex bgcolor="color"?&gt;</literal>. The PI can apply to
504 columns when put in a <sgmltag>colspec</sgmltag>, to rows when put at the
505 beginning of a <sgmltag>row</sgmltag>, or to cells when put in a
506 <sgmltag>entry</sgmltag>.</para>
507
508 <para>The entry colour has precedence over the row colour, that has precedence
509 over the column colour, that has precedence over the table colour.</para>
510
511 <para id="table-color-format">The color can be expressed in hexadecimal
512 notation like for HTML (e.g. <literal>#C0C0C0</literal>) or in a syntax
513 understood by the <filename>colortbl</filename> latex package.</para>
514
515 <para>Here is a<phrase output="pdf">n</phrase><phrase output="html"> PDF
516 output</phrase> example.</para>
517
518 <para output="pdf">
519 <xi:include href="coloured.xml" />
520 </para>
521
522 <!-- The image img-tbl-color.png was built with the command line:
523 ../tools/imagefrom manual.xml tbl-color
524 -->
525
526 <mediaobject output="html">
527 <imageobject>
528 <imagedata align="center" fileref="img-tbl-color" />
529 </imageobject>
530 </mediaobject>
531
532 <para>This table is coded like this:</para>
533
534 <!-- To comment before editing with XXE
535 -->
536 <programlisting><xi:include href="coloured.xml" parse="text"/></programlisting>
537 </section>
538
539 <section id="sec-html-table">
540 <title>HTML Tables</title>
541
542 <para>Since version 0.3.2 dblatex supports HTML tables. Some features are
543 handled differently from CALS tables as illustrated by the following HTML
544 table source example:</para>
545
546 <programlisting language="HTML">&lt;table border="1" width="100%" rules="all"<co
547 id="co-htmltbl-rules" />&gt;
548 &lt;caption&gt;An HTML Table&lt;/caption&gt;<co id="co-htmltbl-title" />
549 &lt;colgroup span="2" valign="top" align="right"/&gt;
550 &lt;?dblatex bgcolor="red"?&gt;<co id="co-htmltbl-bgcolor1" />
551 &lt;/colgroup&gt;
552 &lt;colgroup valign="bottom" align="left" width="5%"<co
553 id="co-htmltbl-widthpct" />&gt;
554 &lt;col align="right" span="2"/&gt;
555 &lt;col valign="top"/&gt;
556 &lt;/colgroup&gt;
557 &lt;colgroup bgcolor="yellow" width="0*"<co id="co-htmltbl-autowidth" />&gt;&lt;?dblatex bgcolor="yellow"?&gt;&lt;/colgroup&gt;
558 &lt;colgroup valign="bottom" align="left" width="15%"/&gt;
559 &lt;colgroup valign="bottom" align="left" width="10%"/&gt;
560 &lt;thead&gt;
561 &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;
562 &lt;/thead&gt;
563 &lt;tfoot&gt;
564 &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;
565 &lt;/tfoot&gt;
566
567 &lt;tr&gt;
568 &lt;td width="10%"&gt;A1&lt;/td&gt;&lt;td&gt;B1&lt;/td&gt;&lt;td&gt;C1&lt;/td&gt;
569 &lt;/tr&gt;
570 &lt;tr&gt;
571 &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;
572 &lt;/tr&gt;
573 &lt;tr&gt;
574 &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;
575 &lt;/tr&gt;
576 &lt;tr&gt;
577 &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;
578 &lt;/tr&gt;
579 &lt;tr&gt;
580 &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;
581 &lt;/tr&gt;
582 &lt;tr bgcolor="blue"<co id="co-htmltbl-bgcolorp" />&gt;
583 &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
584 linkend="co-htmltbl-bgcolorp" />&gt;F6&lt;/td&gt;
585 &lt;/tr&gt;
586 &lt;/table&gt;</programlisting>
587
588 <calloutlist>
589 <callout arearefs="co-htmltbl-rules">
590 <para>The cell borders are specified through the table <sgmltag
591 role="attribute">rules</sgmltag> attribute, and not by any
592 <sgmltag>rowsep</sgmltag> and <sgmltag>colsep</sgmltag> attributes. Therefore
593 it is not possible to set the borders of an individual cell. If no <sgmltag
594 role="attribute">rules</sgmltag> attribute is provided the default setup
595 defined by <parameter>default.table.rules</parameter> parameter is
596 used.</para>
597 </callout>
598
599 <callout arearefs="co-htmltbl-title">
600 <para>The title of a formal HTML table is set through the
601 <sgmltag>caption</sgmltag> element, because the <sgmltag>title</sgmltag>
602 element is not available.</para>
603 </callout>
604
605 <callout arearefs="co-htmltbl-bgcolor1">
606 <para>The cell background colors can be set directly with the bgcolor
607 attribute in <sgmltag>row</sgmltag> (for an entire row color setting),
608 <sgmltag>th</sgmltag>, or <sgmltag>td</sgmltag>, but the dblatex bgcolor
609 Processing Instruction is required in <sgmltag>colgroup</sgmltag> or
610 <sgmltag>col</sgmltag> to set a column color.</para>
611 </callout>
612
613 <callout arearefs="co-htmltbl-widthpct">
614 <para>The relative widths can be expressed as a percentage. The proportional
615 syntax (e.g. "3*") is still available in <sgmltag>colgroup</sgmltag>s.</para>
616 </callout>
617
618 <callout arearefs="co-htmltbl-autowidth">
619 <para>To specify that a column must be as wide as its content, there is no
620 need to use the dblatex autowidth Processing Instruction. You just need to set
621 the related colgroup width attribute to "0*".</para>
622 </callout>
623
624 <callout arearefs="co-htmltbl-widthfix">
625 <para>The fixed widths must be expressed as numbers, and the implicit unit is
626 the point ("pt"). You cannot set a width expressed in a unit like inchs
627 ("in"), centimeters ("cm") and so on.</para>
628 </callout>
629
630 <callout arearefs="co-htmltbl-bgcolorp">
631 <para>The closest enclosing element attribute has precedence over ancestor
632 attributes. This applies to background color too.</para>
633 </callout>
634 </calloutlist>
635
636 <para>This source example is rendered as follow:</para>
637
638 <para output="pdf">
639 <xi:include href="table-html.xml" />
640 </para>
641
642 <!-- The image img-tbl-html.png was built with the command line:
643 ../tools/imagefrom manual.xml tbl-html
644 -->
645
646 <mediaobject output="html">
647 <imageobject>
648 <imagedata align="center" fileref="img-tbl-html" />
649 </imageobject>
650 </mediaobject>
651 </section>
652 </section>