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 Alain ROY <ra...@email.com> on 2004/07/27 00:51:20 UTC

Table borders problem

Hi all,

I have a little problem with a table.
I want to generate a table with a fixed height (4cm), then I want to draw borders around the table, for each column (because I want the vertical lines to be drawed to the bottom of the table even if there is only one or two rows on my table), between header and body, then I want a grey background for the header.
My problem is when I define the header background, the vertical lines disappears behind it. If I define a border for the header cells to redraw those lines, they  aren't aligned with the columns lines of the body.
Does anybody knows if it's possible to draw columns borders over the background or how to align cells borders with columns borders ?

In my following example, I parameter the border width to 2mm for the bad result to be more visible.

<?xml version="1.0" encoding="ISO-8859-1"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
   <fo:layout-master-set>
      <fo:simple-page-master page-width="297mm" page-height="210mm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm" master-name="modele">
         <fo:region-before extent="3cm"/>
         <fo:region-body margin-top="3cm" margin-bottom="3cm"/>
         <fo:region-after extent="2cm" background-color="#DDDDDD"/>
      </fo:simple-page-master>
   </fo:layout-master-set>
   <fo:page-sequence master-reference="modele">
      <fo:static-content flow-name="xsl-region-before">
         <fo:block text-align="start">Page header</fo:block>
      </fo:static-content>
      <fo:static-content flow-name="xsl-region-after">
         <fo:block text-align="start">Page footer</fo:block>
      </fo:static-content>
      <fo:flow flow-name="xsl-region-body">
   
         <fo:table table-layout="fixed" height="4cm" border-width="2mm" border-style="solid">
            <fo:table-column border-width="2mm" border-right-style="solid" column-width="1.5cm"/>
            <fo:table-column border-width="2mm" border-right-style="solid" column-width="2cm"/>
            <fo:table-column border-width="2mm" border-right-style="solid" column-width="3cm"/>
            <fo:table-header font-family="sans-serif" font-size="12pt" font-weight="bold" font-style="italic" display-align="center" text-align="center" border-width="2mm">
               <fo:table-row height="8mm">
                  <fo:table-cell border-width="2mm" padding="1mm 1mm 1mm 1mm" background-color="#BBBBBB" border-style="solid">
                     <fo:block>Col 1</fo:block>
                  </fo:table-cell>
                  <fo:table-cell border-width="2mm" padding="1mm 1mm 1mm 1mm" background-color="#BBBBBB" border-style="solid">
                     <fo:block>Col 2</fo:block>
                  </fo:table-cell>
                  <fo:table-cell border-width="2mm" padding="1mm 1mm 1mm 1mm" background-color="#BBBBBB" border-style="solid">
                     <fo:block>Col 3</fo:block>
                  </fo:table-cell>
               </fo:table-row>
            </fo:table-header>
            <fo:table-body font-family="sans-serif" font-size="10pt">
               <fo:table-row height="5mm">
                  <fo:table-cell/>
               </fo:table-row>
            </fo:table-body>
         </fo:table> 

      </fo:flow>
   </fo:page-sequence>
</fo:root>

Regards
AR
-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: Table borders problem

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Alain ROY wrote:
> I want to generate a table with a fixed height (4cm), then I want to
> draw borders around the table, for each column (because I want the
> vertical lines to be drawed to the bottom of the table even if there
> is only one or two rows on my table), between header and body, then I
> want a grey background for the header. My problem is when I define
> the header background, the vertical lines disappears behind it. If I
> define a border for the header cells to redraw those lines, they
> aren't aligned with the columns lines of the body. Does anybody knows
> if it's possible to draw columns borders over the background or how
> to align cells borders with columns borders ?

There are numerous problems with table column and row borders,
I'm surprised there is something working at all. There are
substantial problems with cell borders too, but they can be
worked around, usually.
Either use cell borders exclusively, or use an outer table
with one row and as much columns as your table should have
and with left and right cell borders only.


J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org