I am having an issue and have not found a solution/workaround (although there are similar questions that have been posed) to the XSL-FO problem with cell background. We are using Apache FOP 0.25 and a rapid upgrade to the newer version another PDF processor is not feasible at the moment.
The thing is that when I set background-color on a cell, the new background filling covers borders of the table that are visible otherwise (0.5pt solid). I have tried a couple of ways to overcome it, but they all lead to suboptimal results:
setting borders on each table-cell separately that has background-color. That works but I see gaps between borders that are set on the cells without background and the ones with. In the example below there would be visible gaps between vertical borders of cell 1.1 and cell 2.1 but not between 2.1 and 3.1.
__________________________
|cell 1.1: background |
|cell 2.1: no background |
|cell 3.1: no background |
--------------------------
Are there any practical workarounds to solve the issue? I am setting background-color on the table-cell element, that should be correct, right?
Many thanks
good example for borders and fill patterns which are work with Apache FOP
<fo:table border="1pt solid black">
<fo:table-body border="inherit">
<fo:table-row border="inherit">
<fo:table-cell border="inherit" background-color="#F2F2F2" number-rows-spanned="2">
<fo:block>data</fo:block>
</fo:table-cell>
<fo:table-cell border="inherit" background-color="#D9D9D9">
<fo:block>data2</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row border="inherit">
<fo:table-cell border="inherit" background-color="#C0C0C0">
<fo:block>data3</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With