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 Olivier Rossel <ol...@anyware-tech.com> on 2002/03/04 11:49:19 UTC

Background color in a cell.

I want to have a background color in a cell of my table.
I used the background-color attribute this way:
<fo:table-row>
    <fo:table-cell number-columns-spanned="2" border-bottom="0.5mm solid 
black" background-color="lightgrey">
                                                                        
                                                                        
                ^^^^^^^^^^^^^^^^^^^^^^^^
     <fo:block font-size="12pt" space-before.optimum="12pt" 
text-align="center">Paragraph</fo:block>
    </fo:table-cell>
    <fo:table-cell number-rows-spanned="2" border-bottom="0.5mm solid 
black" border-left="0.5mm solid black">
     <fo:block font-size="12pt" space-before.optimum="12pt" 
text-align="center">F/C ATA</fo:block>
    </fo:table-cell>
    <fo:table-cell number-rows-spanned="2" border-bottom="0.5mm solid 
black" border-left="0.5mm solid black">
     <fo:block font-size="12pt" space-before.optimum="12pt" 
text-align="center">Proof of compliance</fo:block>
    </fo:table-cell>
    <fo:table-cell number-rows-spanned="2" border-bottom="0.5mm solid 
black" border-left="0.5mm solid black">
     <fo:block font-size="12pt" space-before.optimum="12pt" 
text-align="center">ATA</fo:block>
    </fo:table-cell>
    <fo:table-cell number-rows-spanned="2" border-bottom="0.5mm solid 
black" border-left="0.5mm solid black" border-right="0.5mm solid black">
     <fo:block font-size="12pt" space-before.optimum="12pt" 
text-align="center">MOC</fo:block>
    </fo:table-cell>
    <fo:table-cell number-columns-spanned="2" border-bottom="0.5mm solid 
black">
     <fo:block font-size="12pt" space-before.optimum="12pt" 
text-align="center">Document</fo:block>
    </fo:table-cell>
 </fo:table-row>

 <fo:table-row>
    <fo:table-cell border-bottom="0.5mm solid black" border-right="0.5mm 
solid black" background-color="lightgrey">
                                                                        
                                                                        
                     ^^^^^^^^^^^^^^^^^^^^^^^^
     <fo:block font-size="12pt" space-before.optimum="12pt" 
text-align="center">Reference</fo:block>
    </fo:table-cell>
    <fo:table-cell border-bottom="0.5mm solid black" 
background-color="lightgrey">
                                                                        
                            ^^^^^^^^^^^^^^^^^^^^^^^^
     <fo:block font-size="12pt" space-before.optimum="12pt" 
text-align="center">Title</fo:block>
    </fo:table-cell>
    <fo:table-cell border-bottom="0.5mm solid black" border-right="0.5mm 
solid black">
     <fo:block font-size="12pt" space-before.optimum="12pt" 
text-align="center">Reference</fo:block>
    </fo:table-cell>
    <fo:table-cell border-bottom="0.5mm solid black">
     <fo:block font-size="12pt" space-before.optimum="12pt" 
text-align="center">Issue</fo:block>
    </fo:table-cell>
   </fo:table-row>

The result can be seen at http://www.anyware-tech.com/test.pdf

Visually, the background color overrides the borders of each cell.
Is it a known bug? or is there an attribute to avoid this behaviour?