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 paul <sa...@gmx.ch> on 2007/02/03 13:26:51 UTC

block-container and margin/padding properties

Hello

I need a table with cells of equal sizes. It is important, that if the text is
too big for a cell, that the text gets cropped, so the cell ddoesn't grow. For
this I've introduced block-containers, for which I define a height plus set
overflow=hidden. I also define a margin, as I want to have a certain space
between the edge of the cell and the content(text). This system nearly works,
except that on the left and on the right side of the block-container there is a
space outside the block container plus the same amount of space on the inside of
the block-container, while on top and bottom there is just space outside of the
block-container (as I had wished). In short: margins on the left and right side
get duplicated (see diagrams below).

I admit that I have a very limited understanding of the border/margin/space
properties in general, but I have tried out so many things now, and have tried
to find reference, and nothing seems to work. I appreciate help, even if you
just point me to a good reference.

---------------DIAGRAMS--------------------------------------

diagramm: outer border = edge of table-cell, inner border = border of
 block-container/block

My goal:(space between border and text on side and top should be equal
 ___________________
|  _______________  |
| |xxxxxxxxxxxxxxx| |
| |xxxxxxxxxxxxxxx| |
| |_______________| |
|___________________|


What I get: (space around blockcontainer gets repeated on the inside-left and
inside-right)
 ___________________
|  _______________  |
| | xxxxxxxxxxxxx | |
| | xxxxxxxxxxxxx | |
| |_______________| |
|___________________|

-------------------------------------------------------------------------

<fo:table table-layout="fixed" width="100%" 
keep-together.within-page="always" break-before="page">
	<fo:table-column column-number="1" column-width="{$paperwidth} div 2"/>
	<fo:table-column column-number="2" column-width="{$paperwidth} div 2"/>
	<fo:table-body>
		<fo:table-row>
			<fo:table-cell column-number="1" border-style="none" 
			border-width="1pt" overflow="hidden">
			
			<fo:block-container overflow="hidden" 
			height="{$Papierhoehe} div 4" margin="{$card-margin}">
				<fo:block text-align="left" >
				Paul doesn't know xsl very well... poor fella!
				</fo:block>
			</fo:block-container>
			
			</fo:table-cell>
		<...>


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


Re: block-container and margin/padding properties

Posted by paul <sa...@gmx.ch>.
Jay and Andreas, thanks for your helpful ideas... The article about
indent-inheritance is very interesting, and probably it is indeed a inheritance
problem. But from how I understand the document, indents should be inherited,
not margins... anyways, my workaround for the moment is to reset the margins of
the block within the block-container by assigning them the negative value of the
margin of the container. That works :)

...
<fo:block-container overflow="hidden" height="{$paperheight} div 4 -
2*{$card-margin}" margin="{$card-margin}">
<fo:block text-align="left" margin-left="-{$card-margin}"                      
 margin-right="-{$card-margin}">
...


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


Re: block-container and margin/padding properties

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Feb 3, 2007, at 13:26, paul wrote:

> <snip />
> In short: margins on the left and right side get duplicated (see  
> diagrams below).

Just to be sure, I'd check if it is not indent-inheritance you're  
bitten by...

See: http://wiki.apache.org/xmlgraphics-fop/IndentInheritance


HTH!

Cheers,

Andreas

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


Re: block-container and margin/padding properties

Posted by Jay Bryant <ja...@bryantcs.com>.
> Hello
>
> I need a table with cells of equal sizes. It is important, that if the 
> text is
> too big for a cell, that the text gets cropped, so the cell ddoesn't grow. 
> For
> this I've introduced block-containers, for which I define a height plus 
> set
> overflow=hidden. I also define a margin, as I want to have a certain space
> between the edge of the cell and the content(text). This system nearly 
> works,
> except that on the left and on the right side of the block-container there 
> is a
> space outside the block container plus the same amount of space on the 
> inside of
> the block-container, while on top and bottom there is just space outside 
> of the
> block-container (as I had wished). In short: margins on the left and right 
> side
> get duplicated (see diagrams below).
>
> I admit that I have a very limited understanding of the 
> border/margin/space
> properties in general, but I have tried out so many things now, and have 
> tried
> to find reference, and nothing seems to work. I appreciate help, even if 
> you
> just point me to a good reference.
>
> ---------------DIAGRAMS--------------------------------------
>
> diagramm: outer border = edge of table-cell, inner border = border of
> block-container/block
>
> My goal:(space between border and text on side and top should be equal
> ___________________
> |  _______________  |
> | |xxxxxxxxxxxxxxx| |
> | |xxxxxxxxxxxxxxx| |
> | |_______________| |
> |___________________|
>
>
> What I get: (space around blockcontainer gets repeated on the inside-left 
> and
> inside-right)
> ___________________
> |  _______________  |
> | | xxxxxxxxxxxxx | |
> | | xxxxxxxxxxxxx | |
> | |_______________| |
> |___________________|
>
> -------------------------------------------------------------------------
>
> <fo:table table-layout="fixed" width="100%"
> keep-together.within-page="always" break-before="page">
> <fo:table-column column-number="1" column-width="{$paperwidth} div 2"/>
> <fo:table-column column-number="2" column-width="{$paperwidth} div 2"/>
> <fo:table-body>
> <fo:table-row>
> <fo:table-cell column-number="1" border-style="none"
> border-width="1pt" overflow="hidden">
>
> <fo:block-container overflow="hidden"
> height="{$Papierhoehe} div 4" margin="{$card-margin}">
> <fo:block text-align="left" >
> Paul doesn't know xsl very well... poor fella!
> </fo:block>
> </fo:block-container>
>
> </fo:table-cell>
> <...>

Hi, Paul

Just as a work-around, you can specify all four margins and divide the left 
and right margins by 2, thus:

<fo:block-container overflow="hidden" height="{$Papierhoehe} div 4" 
margin-top="{$card-margin}" margin-bottom="{$card-margin}" 
margin-left="{$card-margin div 2}" margin-right="{$card-margin div 2}">

Jay Bryant
Bryant Communication Services 



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