You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Manuel Mall <mm...@arcus.com.au> on 2005/11/18 12:37:32 UTC

border-spacing / border-separation

We have a testcase in the repository for the border-spacing / 
border-separation properties which currently passes:
table_border-collapse_separate_border-spacing.xml

However, I think it shouldn't. Firstly the table borders on the 2nd 
table are incorrectly positioned. But that's not the main point.

It appears that fop trunk currently reserves border-spacing/2 on the 
outside of cells adjacent to the table edges. After looking at the CSS2 
spec and various examples I believe the full value of border-spacing 
should be reserved along the edges. Example:

<fo:table border-spacing="5pt 0pt">
  <fo:table-row>
	<fo:table-cell>...</
	<fo:table-cell>...</
  </fo:table-row>
</fo:table>

is currently rendered like:
[2.5pt gap][cell data][5pt gap][cell data][2.5pt gap]

while I think it should be:
[5pt gap][cell data][5pt gap][cell data][5pt gap]

What do others think?

Manuel

Re: border-spacing / border-separation

Posted by Manuel Mall <mm...@arcus.com.au>.
On Mon, 21 Nov 2005 08:58 pm, Jeremias Maerki wrote:
> I believe the current behaviour is (almost) correct. First, you've
> already found out yourself why the outer table border is correctly
> positioned (due to margin="0pt"). 

That is not what I was alluding to. The table is too wide which is 
caused by FOP not supporting width="auto". However, in this case all 
width values are known, i.e. all columns have explicit width. Therefore 
no real auto column layout is required. But I accept that this is a 
limitation of the current implementation although aren't we in that 
respect still behind 0.20.5?

> Second, the 2.5pt gap is correct as 
> is described in fo:table:

Thanks for the pointer - I certainly missed that one and only read the 
property definition.

<snip/>
> It's interesting that CSS seems to say that the border-spacing is
> only used between adjacent table-cells, not between the outer cells
> the border's padding area. This looks like a contradiction. But then,
> the FO spec takes precedence.
>

That bit had me confused as well - but even the example in the CSS spec 
shows the border-spacing being applied in full around the table. So do 
various CSS examples I found around the web (of course you need to view 
any of these not using IE which once again does its own thing).

In then end the XSL-FO border-separation property seems to behave 
differently than the CSS border-spacing property (half the 
border-separation property value around the outside of a fo:table vs 
full value of the border-spacing property value around a HTML table) 
and that may explain why they have been given different names.

<snip/>
>
> Jeremias Maerki

Manuel

Re: border-spacing / border-separation

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I believe the current behaviour is (almost) correct. First, you've
already found out yourself why the outer table border is correctly
positioned (due to margin="0pt"). Second, the 2.5pt gap is correct as is
described in fo:table:

"If the value of the "border-collapse" property is "separate" the border
is composed of two components. The first, which is placed with the
inside edge coincident with the outermost table grid boundary line, has
the width of half the value for the "border-separation" property. It is
   ^^^^^^^^^^^^^^^^^^^^^^^^^^
filled in accordance with the "background" property of the fo:table.
Second, outside the outermost table grid boundary line is placed, for
each side of the table, a border based on a border specified on the
table."

However, this 2.5pt gap is not applied in b-p-d, only in i-p-d. I'll
look into that.

It's interesting that CSS seems to say that the border-spacing is only
used between adjacent table-cells, not between the outer cells the
border's padding area. This looks like a contradiction. But then, the FO
spec takes precedence.

On 18.11.2005 12:37:32 Manuel Mall wrote:
> We have a testcase in the repository for the border-spacing / 
> border-separation properties which currently passes:
> table_border-collapse_separate_border-spacing.xml
> 
> However, I think it shouldn't. Firstly the table borders on the 2nd 
> table are incorrectly positioned. But that's not the main point.
>
> It appears that fop trunk currently reserves border-spacing/2 on the 
> outside of cells adjacent to the table edges. After looking at the CSS2 
> spec and various examples I believe the full value of border-spacing 
> should be reserved along the edges. Example:
> 
> <fo:table border-spacing="5pt 0pt">
>   <fo:table-row>
> 	<fo:table-cell>...</
> 	<fo:table-cell>...</
>   </fo:table-row>
> </fo:table>
> 
> is currently rendered like:
> [2.5pt gap][cell data][5pt gap][cell data][2.5pt gap]
> 
> while I think it should be:
> [5pt gap][cell data][5pt gap][cell data][5pt gap]
>
> What do others think?


Jeremias Maerki