W3C home > Mailing lists > Public > xsl-editors@w3.org > January to March 2008

Explicit Row Height, table-cell’s Borders and border-separation

From: Vincent Hennebert <vincent.hennebert@anyware-tech.com>
Date: Mon, 28 Jan 2008 16:15:54 +0000
Message-ID: <479DFFBA.8020500@anyware-tech.com>
To: xsl-editors@w3.org
CC: fop-dev@xmlgraphics.apache.org

Dear XSL Editors,

As far as I can tell the XSL-FO 1.1 Recommendation doesn’t indicate 
whether an explicit height set on a table-row element should include the 
table’s border-separation and the children cells’ border widths, or not. 
In section 7.15.6, a reference to CSS 2 is made “for a discussion of the 
‘height’ property in tables”, but the CSS 2 Recommendation is itself not 
clear what the height of a cell should be in this context.

Also, in section 6.7.9, “fo:table-row”, the “row-height trait” is 
mentioned but is not referenced anywhere else.

So, in the following example:
    <fo:table table-layout="fixed" width="100%" 
      border-collapse="separate"
      border="1pt solid black"
      border-separation="6pt">
      <fo:table-body font-size="8pt" line-height="10pt">
        <fo:table-row block-progression-dimension="45pt">
          <fo:table-cell border="2pt solid black">
            <fo:block>Cell 1</fo:block>
          </fo:table-cell>
          <fo:table-cell border="5pt solid black">
            <fo:block>Cell 2</fo:block>
          </fo:table-cell>
        </fo:table-row>
      </fo:table-body>
    </fo:table>

What should be the final block-progression-dimensions for the cells?
There are 3 possibilities:
1. the explicit row height shall include the cells’ borders and the 
   table’s border-separation:
   - height of cell 1 = 3 (half of border-separation)
            + 2 (border-before)
            + 10 (b-p-d)
            + 2 (border-after)
            + 3 (half of border-separation)
            = 20pt
   - height of cell 2 = 3 + 5 + 10 + 5 + 3 = 26pt  
   - height of row = max(explicit row height, height of cell 1, height of cell 2)
                   = 45pt
   As a consequence the final block-progression-dimensions of the cells 
   are re-evaluated to match the row’s explicit height:
   - b-p-d of cell 1 = 45 - (3 + 2 + 2 + 3) = 35pt
   - b-p-d of cell 2 = 45 - (3 + 5 + 5 + 3) = 29pt

2. the explicit row height shall include the cells’ borders but not the 
   table’s border-separation:
   - height of cell 1 = 2 + 10 + 2 = 14pt
   - height of cell 2 = 5 + 10 + 5 = 20pt
   - height of row = max(45, 14, 20) = 45pt
   So the final block-progression-dimensions of the cells would be:
   - b-p-d of cell 1 = 45 - (2 + 2) = 41pt
   - b-p-d of cell 2 = 45 - (5 + 5) = 35pt

3. the explicit row height shall include only the cells’ 
   block-progression-dimensions:
   - height of cell 1 = 10pt
   - height of cell 2 = 10pt
   - height of row = max(45, 10, 10) = 45pt
   So the final block-progression-dimensions of the cells would be:
   - b-p-d of cell 1 = 45pt
   - b-p-d of cell 2 = 45pt
   But then what would be the final row height? Should it be re-computed 
   as in the case where the row height is left to auto? Then:
   - height of cell 1 = 2 + 45 + 2 = 49pt
   - height of cell 2 = 5 + 45 + 5 = 55pt
   - height of row = max(49, 55) = 55pt
   So final b-p-ds of the cells:
   - b-p-d of cell 1 = 55 - (2 + 2) = 51pt
   - b-p-d of cell 2 = 45pt

There are some hints in the Recommendation which would tend towards 
solution #2, but a clarification in this area would be much appreciated.

Thanks,
Vincent Hennebert


-- 
Vincent Hennebert                            Anyware Technologies
http://people.apache.org/~vhennebert         http://www.anyware-tech.com
Apache FOP Committer                         FOP Development/Consulting
Received on Monday, 28 January 2008 16:14:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:59 GMT