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 Jason Vincent <fo...@yahoo.com> on 2003/08/27 21:34:40 UTC

horizontal centering - not dynamic

Hi all,

I'm having trouble getting images horizontally
centered in a table.  I've followed the FAQ and used
the proportional-column-width(1) method to get it
centered.  The problem is that the images are of a
random size.  The FAQ has the middle column set at a
fixed width, which causes my images to be scaled down
to fit the fixed width or for the narrow images they
become left-justified within the middle column.  When
I remove the column width or set the width to 100% in
the center column, it simply divides the area into 3
even width columns.  

Is there a way I can get the middle column to be a
variable width, one that changes depending on the
width of each images?

Thanks all,
JasonV


Here is a sample of the table that I'd like to have
the image centered.

<fo:table width="100%" table-layout="fixed">
	<fo:table-column
column-width="proportional-column-width(1)"/>
	<fo:table-column />
	<fo:table-column
column-width="proportional-column-width(1)"/>
	<fo:table-body>
		<fo:table-row>
			<fo:table-cell/>
			<fo:table-cell display-align="center">
				<fo:block>
					<fo:external-graphic height="2in"
src="{$imagePath}/{$imageName}"/>
				</fo:block>
			</fo:table-cell>
			<fo:table-cell/>
		</fo:table-row>
	</fo:table-body>
</fo:table>




__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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


Re: horizontal centering - not dynamic

Posted by Jason Vincent <fo...@yahoo.com>.
<fo:block text-align="center"> worked great... thanks!

I'm not sure why I thought it was so difficult to
center something.  

I see now that the FAQ was only talking about
centering tables and not the content within them.

Thanks again,
JasonV


--- "J.Pietschmann" <j3...@yahoo.de> wrote:
> Jason Vincent wrote:
> > I'm having trouble getting images horizontally
> > centered in a table.  I've followed the FAQ and
> used
> > the proportional-column-width(1) method to get it
> > centered.
> 
> Hm. Why doesn't
>   <fo:block text-align="center">
>     <fo:external-graphic src="foo.jpg"/>
>   </fo:block>
> work for you?
> 
> J.Pietschmann
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> fop-user-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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


Re: horizontal centering - not dynamic

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Jason Vincent wrote:
> I'm having trouble getting images horizontally
> centered in a table.  I've followed the FAQ and used
> the proportional-column-width(1) method to get it
> centered.

Hm. Why doesn't
  <fo:block text-align="center">
    <fo:external-graphic src="foo.jpg"/>
  </fo:block>
work for you?

J.Pietschmann




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


RE: horizontal centering - not dynamic

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> Is there a way I can get the middle column to be a
> variable width, one that changes depending on the
> width of each images?

Are you really going to use the first and third column?
If not, try :

<fo:table-row>
	<fo:table-cell display-align="center" number-columns-spanned="3">
	<fo:block>
		<fo:external-graphic height="2in" 
				src="{$imagePath}/{$imageName}"/>
	</fo:block>
	</fo:table-cell>
</fo:table-row>

for all rows containing images... Should get you on track.

Greetz,

Andreas Delmelle

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