Hi,

Abel Braaksma a écrit :
> Thanks for your quick response!
> 
> 
> Andreas L Delmelle wrote:
>> The reason is twofold:
>> -> FOP 0.93 does not yet offer support for border-collapse="collapse"
>> (nor "collapse-with-precedence")
>> -> with border-collapse="separate", borders only apply to fo:table or
>> fo:table-cell
> 
> Aha, so, in other words: because "collapse" is not supported, the
> properties that depend on them (among others: all border-related
> properties of fo-table-row, fo:table-body, fo:table-column) are not
> supported either, because they only have meaning when "collapse" is set.
> This is according to the XSL-FO spec.

Actually you may do the following:

<fo:table width="100%"
  table-layout="fixed"
  border-collapse="separate"
  border-separation="4pt"
  border="4pt solid black">
  <fo:table-column number-columns-repeated="2"
    column-width="proportional-column-width(1)"
    border="2pt solid green"/>
  <fo:table-body>
    <fo:table-row border="4pt solid red">
      <fo:table-cell border="inherit">
        <fo:block>Cell 1</fo:block>
      </fo:table-cell>
      <fo:table-cell border="inherit">
        <fo:block>Cell 2</fo:block>
      </fo:table-cell>
    </fo:table-row>
    <fo:table-row border="4pt solid green">
      <fo:table-cell border="from-table-column()">
        <fo:block>Cell 4</fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block>Cell 5</fo:block>
      </fo:table-cell>
    </fo:table-row>
  </fo:table-body>
</fo:table>

You will get a black border around the table, red borders around the
cells of the first row, a green border around the first cell of the
second row.
You will get warnings from FOP that in the separate border model borders
on table-column and table-row are not applicable, but in this particular
case we want to take advantage of inheritance. You must still specify
border="inherit" on table-cells because border properties are not
inheritable by default, but that allows you to specify them only at one
place.
All of that leads to the following question: IIC the above is allowed by
the spec, so the warning messages should not be displayed. Or is it not?
What do others think?


>>> 2. Is there a way, other than using borders on each cell, to get the
>>> borders for the column/row to work? Is there a shortcut way to just
>>> set all borders of table/rows/columns/cells to the same properties?
>>
>> Not unless someone gets around to implementing
>> border-collapse="collapse", I'm afraid... :(

I'm on it. Should be available in the next release.


> Not exactly a complete answer, but because it is so easy to implement
> and does what I want, here's a solution:
> 
> 1. Set your table border settings as follows (use of shorthand is
> necessary):
> 
> <fo:table border="1pt red solid" border-right="none" border-bottom="none">
> 
> 2. Set each cell border settings as follows (use of shorthand is
> necessary):
> 
> <fo:table-cell
>    border="from-nearest-specified-value(border)"
>    border-left="none"
>    border-top="none">
> 
> make sure you do not set borders on the fo:table-row, for:table-column
> or fo:table-body, because that would change the behavior of this
> solution. I'm sure this solution has been found out but many before, but
> I did not find it yet, which is why I like to share it. Not sure whether
> this solution will work the same cross-renderer, or when border-collapse
> setting is changed.

Indeed, that will perfectly work if every cell of the table must have
the same borders. If you need different borders per row/column you'll
have to use something like above.


Vincent


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to