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 Chris Rowe <ch...@orange.net> on 2003/01/06 17:42:18 UTC

Problem: Expanding tables and background colours

I have a table of fixed height which can contain a varying number of
lines of data. I've set the background colour of some columns in order 
to highlight them. I need a way to make sure the highlighting of the 
columns continues all the way to the bottom of the table. 

Unless there is a line of data the background colour doesn't appear. 
I've currently written a template which counts the number of lines and 
then prints the correct number of blank lines out. This works to a 
point but fails as soon as the descriptions in the lines get too long, 
they then wrap over onto the next line, then when I print the blank 
lines out there are too many and the table expands.

I've also tried to do the background colour in a seperate static-
content via <fo:block-container> but it places the block of colour 
above the text not behind it! (z-index is not implemented yet!)

So I need a way to stop the <fo:table height="120mm"> from expanding, or
print one extra blank line out at the end of the table which expands to 
fill the whole of the rest of the table and so show the background 
colour, or set a background block of colour which is behind the text or 
another solution?

Any ideas?

Thanks,
Chris



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


Re: Problem: Expanding tables and background colours

Posted by Joerg Pietschmann <j3...@yahoo.de>.
On Monday 06 January 2003 17:42, Chris Rowe wrote:
> I have a table of fixed height which can contain a varying number of
> lines of data. I've set the background colour of some columns in order
> to highlight them. I need a way to make sure the highlighting of the
> columns continues all the way to the bottom of the table.

Have you tried
 <fo:table background-color="..."
or
 <fo:block background-color="...">
   <fo:table ...
(Well, I didn't)

J.Pietschmann

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


Re: Problem: Expanding tables and background colours

Posted by Clay Leeds <cl...@medata.com>.
Chris,

I don't know if/how this'll help, but here's how I force EMPTY content to 
have at least a non-breaking space:

   <xsl:call-template name="EMPTYCHECK">
     <xsl:with-param name="counter" select="NODE/TO/SELECT"/>
   </xsl:call-template>

   <xsl:template name="EMPTYCHECK">
     <!-- replaces empty element(s) with non-breaking space character - 
&#160; -->
     <xsl:param name="counter"/>
     <xsl:choose>
       <xsl:when test="$counter !=''">
         <fo:block>
           <xsl:value-of select="$counter"/>
         </fo:block>
       </xsl:when>
       <xsl:otherwise>
         <fo:block>&#160;</fo:block>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>

I also have one which does not place a BREAK:

   <xsl:template name="EMPTYCHECKNOBREAK">
     <!-- replaces empty element(s) with non-breaking space character - 
&#160; -->
     <xsl:param name="counter"/>
     <xsl:choose>
       <xsl:when test="$counter !=''">
         <xsl:value-of select="$counter"/>
       </xsl:when>
       <xsl:otherwise>&#160;</xsl:otherwise>
     </xsl:choose>
   </xsl:template>

Have you tried putting the content in the block (not block-container) and 
set the background-color of that block? Something like this:

   fo table-column/
   fo table-body
     fo table-row
       fo table-cell
         fo block background-color:pink
           <xsl:call-template name="EMPTYCHECK">
             <xsl:with-param name="counter" select="NODE/TO/SELECT"/>
           </xsl:call-template>
         /fo block background-color=pink
       /fo table-cell
     /fo table-row
   /fo table-body

I don't know how this'll handle the counting, but you might find a portion 
of this useful.

Cheers,

Web Maestro Clay

At 08:42 AM 1/6/2003, you wrote:
>I have a table of fixed height which can contain a varying number of
>lines of data. I've set the background colour of some columns in order
>to highlight them. I need a way to make sure the highlighting of the
>columns continues all the way to the bottom of the table.
>
>Unless there is a line of data the background colour doesn't appear.
>I've currently written a template which counts the number of lines and
>then prints the correct number of blank lines out. This works to a
>point but fails as soon as the descriptions in the lines get too long,
>they then wrap over onto the next line, then when I print the blank
>lines out there are too many and the table expands.
>
>I've also tried to do the background colour in a seperate static-
>content via <fo:block-container> but it places the block of colour
>above the text not behind it! (z-index is not implemented yet!)
>
>So I need a way to stop the <fo:table height="120mm"> from expanding, or
>print one extra blank line out at the end of the table which expands to
>fill the whole of the rest of the table and so show the background
>colour, or set a background block of colour which is behind the text or
>another solution?
>
>Any ideas?
>
>Thanks,
>Chris
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: fop-user-help@xml.apache.org

- Clay Leeds
- Web Developer
- cleeds@medata.com 


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