xslt.base.common.table.xsl Maven / Gradle / Ivy
Adjust column width values for HTML or XSL-FO
CALS tables support column widths expressed in absolute (2.5in),
relative (2*), and mixed terms (1.5*+0.5in). HTML and XSL-FO support
column widths
expressed in either absolute units (only pixels in the HTML case)
or as a percentage of the total table width. This template takes an
HTML colgroup containing columns with widths expressed in CALS
terms and returns the equivalent group with columns expressed in terms
acceptable to HTML or XSL-FO.
If there are no relative widths, the absolute widths are returned.
If there are no absolute widths, the relative widths are returned.
If there are a mixture of relative and absolute widths,
If the table width is absolute, all the column widths are converted
to absolute widths and those are returned.
If the table width is relative, all the column widths are converted
to absolute widths based on a
table.width.nominal . Then each width is
converted back to a percentage and those are returned.
table-width
The width of the table.
colgroup
The column group to adjust.
abspixels
Specifies if absolute widths should be expressed in pixels: 0 for
false, any other value for true. Converting lengths to pixels is dependent
on the pixels.per.inch parameter.
The adjusted column group.
1
6in
1
6in
1
'100%'
1
6in
100%
in
%
Warning: table is wider than specified width. (
vs.
)
%
in
Converts a length to pixels
This function converts a length, for example, “3mm” or “2in”,
into an integral number of pixels. The size of a pixel is determined
by the pixels.per.inch parameter.
The following units are recognized: inches (in), centimeters
(cm), milimeters (mm), picas (pc), points (pt), and pixels (px).
A value specified without units is assumed to be pixels. For convenience,
if a percentage is provided, it is returned unchanged.
If an unrecognized unit is specified, it is treated like “1in”.
length
The length to convert.
The converted length, an integral number of pixels, unless the
length specified was a percentage, in which case it is returned unchanged.
1in
96
192
100pt
133
50%
'50%'
10barleycorn
96
Unrecognized units in f:convert-length:
Generates an HTML colgroup .
Generates an HTML colgroup for the CALS table.
cols
The number of columns in the table.
A sequence of one or more col elements.
Generates an HTML col .
Generates an HTML col for a
colgroup .
See generate-colgroup .
countcol
The number of the column.
A col element.
1
1