19

I have to draw solid lines as border.

I am using this loc

<fo:table border="solid 0.1mm black">

but it draws only surrounded lines. It is not applied to all cells and rows. Is it possible to draw solid lines as borders with minimum coding, like not setting borders for cell and rows separately as:

<fo:table-row  border="solid 0.1mm black">
Jens
  • 69,818
  • 15
  • 125
  • 179
Avyaan
  • 1,285
  • 6
  • 20
  • 47

1 Answers1

40

Add the border attribute to all table-cell elements. You can see here that borders are not inherited: http://www.w3.org/TR/xsl11/#border

While it doesn't save any typing, you could help future support of your stylesheet by using attribute sets:

<xsl:attribute-set name="myBorder">
  <xsl:attribute name="border">solid 0.1mm black</xsl:attribute>
</xsl:attribute-set>
...
  <fo:table-cell xsl:use-attribute-sets="myBorder">
    ...

Then, when you need to change all, you just change it in one place.

G. Ken Holman
  • 4,333
  • 16
  • 14