You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Fries, Markus, fiscus GmbH, Bonn" <M....@fiscus.info> on 2002/05/27 15:23:56 UTC
drawing a table with different line-widths
Hi,
I have to layout a table like this:
====================
= - - =
= - header - =
= - - =
====================
= - - =
= - - =
=------------------=
.
.
.
= - last - =
= - - =
====================
My first try was to define border properties on the header, the body and
around all cells. I thought I got it, but when I printed in postscript the
lines were stacked in each other. I used PDF first and that was fine. I need
to get PS though.
Now my second try looks like this
<fo:table>
<xsl:call-template name="Tabelle"/>
<fo:table-body border-left="1.5pt" border-right="1.5pt"
border-top="0pt" border-bottom="0pt"
border-style="solid">
<xsl:apply-templates select="..." mode="tabelle"/>
</fo:table-body>
</fo:table>
<xsl:template name="geheimhaltungsTabelle">
<fo:table-column column-width="50mm"/>
<fo:table-column column-width="50mm"/>
<fo:table-column column-width="50mm"/>
<fo:table-header border-width="1.5pt" border-style="solid">
<fo:table-row>
<fo:table-cell><fo:block
font-weight="bold">...</fo:block></fo:table-cell>
<fo:table-cell border-top="0pt" border-bottom="0pt"
border-right="0.5pt" border-left="0.5pt"
border-style="solid">
<fo:block font-weight="bold">middle cell</fo:block></fo:table-cell>
<fo:table-cell><fo:block
font-weight="bold">Name</fo:block></fo:table-cell>
</fo:table-row>
</fo:table-header>
</xsl:template>
<xsl:template match="..." mode="tabelle">
<fo:table-row>
<fo:table-cell border-top="0pt" border-bottom="0.5pt"
border-left="0pt" border-right="0pt" border-style="solid">
<fo:block><xsl:value-of select="..."/></fo:block></fo:table-cell>
<fo:table-cell border-top="0pt" border-bottom="0.5pt"
border-left="0.5pt" border-right="0.5pt" border-style="solid">
<fo:block><xsl:value-of select="..."/></fo:block></fo:table-cell>
<fo:table-cell border-top="0pt" border-bottom="0.5pt"
border-left="0pt" border-right="0pt" border-style="solid">
<fo:block><xsl:value-of select="..."/></fo:block></fo:table-cell>
</fo:table-row>
</xsl:template>
results in a gap between header and body. And of course I still have to fix
the bottom line. I tried fop 0.20.2 and 0.20.3-2002-03-04. I think it
might have s.th. to do with the border-collapse property, but as it seems
fop or I do not understand the spec.
Can anybody help please?
Best regards
Markus Fries
Re: drawing a table with different line-widths
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Fries, Markus, fiscus GmbH, Bonn wrote:
> Now my second try looks like this
...
> results in a gap between header and body. And of course I still have to fix
> the bottom line. I tried fop 0.20.2 and 0.20.3-2002-03-04. I think it
> might have s.th. to do with the border-collapse property, but as it seems
> fop or I do not understand the spec.
The implementation for collapsing borders is, well, incomplete.
Read the comments near the end of src/../fo/flow/TableCell.java
why it's not easy to adhere to the spec.
You should probably use border-bottom on the blocks within the
table cells and refrain from specifying different widths for
border-top and border-bottom.
Happy tampering!
J.Pietschmann