Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XSLFO: Table/scale-to -fit /column-width

621 views
Skip to first unread message

DStei

unread,
Mar 14, 2003, 3:53:59 AM3/14/03
to
Hello,
I have a big xml-document (the pdf is about 200 pages), which includes
many different tables. I do not want to include the information about
the column-width in the xml-document. The Stylesheet should somehow
adjust the column-width automatically (like HTML), depending on how
much text the cell contains. I already tried
column-width="scale-to-fit" and columnn-width="auto". I am using fop.
None of it works. Here is my script:

<fo:table space-after="10pt" space-before="10pt" table-layout="????">
<fo:table-column
column-width="proportional-column-width(100)???"/>
<fo:table-column column-width="scale-to-fit????"/>
<fo:table-column column-width="auto???"/>
<fo:table-body>
<xsl:for-each select="tr">
<fo:table-row>
<xsl:for-each select="td">
<fo:table-cell border-style="solid" border-width="1pt" >
<fo:block space-after="5pt" space-before="5pt"><xsl:value-of
select="."/></fo:block>
</fo:table-cell>
</xsl:for-each>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>


Thanks in advance

Diana Steiner

Gustaf Liljegren

unread,
Mar 14, 2003, 10:31:51 AM3/14/03
to
ds...@ids.de (DStei) wrote:

> I have a big xml-document (the pdf is about 200 pages), which includes
> many different tables. I do not want to include the information about
> the column-width in the xml-document.

My experience is that generating nice tables is a very layout-oriented task.
So generally, unless your tables are very simple, there is almost certainly
a need for at least some table layout properties in your schema, and column
width use to be one of them.

> The Stylesheet should somehow
> adjust the column-width automatically (like HTML), depending on how
> much text the cell contains.

The FO equivalent is table/@table-layout="auto". Just make sure first that
your formatter has implemented it. My guess is that "auto" is harder to
implement than "fixed", and therefore less supported.

There are good alternatives however. Even if you have a column width
property in your schema, you shouldn't need to manually specify each column
width while editing. Depending on the flexibility in your editor, you can
make almost a WYSIWYG interface for users (i.e. resizing a table columns
have a real effect in your PDF output).

Gustaf

han

unread,
Mar 15, 2003, 2:03:25 PM3/15/03
to
Hi dstei

Only Antenna xsl formatter supports table-layout=auto. fop and xep doesn't.

ds...@ids.de (DStei) wrote in message news:<a235326e.0303...@posting.google.com>...

0 new messages