That is because each row in those small inner tables (Name, Address, Email,
ec.) must be left-aligned. But each of those rows containing business card
tables must be centered on the page. Can you fix my code?
Thank you.
Vincent Hennebert-2 wrote:
>
> Hi,
>
> text-align is an inherited property, so you need it to specify only once
> at the root of the document. However, you have a text-align="left"
> further down the document tree in your code below. Maybe that’s the
> origin of your problem.
>
> HTH,
> Vincent
>
>
> gennady wrote:
>> Hi,
>> Here is the snippet of the code that should print horizontally 1 or 2
>> business card-like tables inside each row. But they became left -
>> justified.
>> And I need them to be centered. I put text-align="center" numerous times
>> and
>> it didn't help. Basically I did not right this code. My job was to add
>> images and make them centerd. I added the images successfully, as you
>> see,
>> but couldn't center the tables.
>> Imagine you have 2 business cards on 1 row:
>> FOTO Full Name FOTO Full Name
>> 40x40 Address 40x40 Address
>>
>> City, ST Zip City, ST Zip
>>
>> Telephone Telephone
>>
>> Email Email
>> Or only 1 card:
>> FOTO Full Name
>> 40x40 Address
>>
>> City, ST Zip
>> Telephone
>>
>> Email
>> Also is there a way to print out generated FOP output after processing
>> through the scriptlets code?
>> Thank you,
>>
>> -Gennady
>> <fo:block text-align="center">
>> <fo:table text-align="center" table-layout="fixed" hyphenate="true"
>> language="en" width="100%">
>> <fo:table-column column-width="2cm"/>
>> <fo:table-column column-width="4cm"/>
>> <fo:table-column column-width="proportional-column-width(1)"/>
>>
>> <!-- we will paint three columns if there are more than one agent
>> -->
>> <% if (agentNumber > 1) { %>
>> <fo:table-column column-width="2cm"/>
>> <fo:table-column column-width="4cm"/>
>> <fo:table-column column-width="proportional-column-width(1)"/>
>>
>> <% } %>
>>
>> <fo:table-body>
>> <fo:table-row text-align="center"> <!-- first group of Agent -->
>>
>> <%
>> for (i=0; i < agentNumber; i=i+3)
>> {
>> // for printing the Agent name
>> for (j=i; (j < agentNumber & j<=(i+2)); j++)
>> {
>> %>
>> <fo:table-cell text-align="center">
>> <fo:block>
>> <fo:external-graphic src="<%=
>> arrAgent[j].getThumbImageUrl()%>" width="40px" height="40px"/>
>> </fo:block>
>> </fo:table-cell>
>> <fo:table-cell>
>> <fo:block margin-left="0pt" padding-left="5pt">
>> <fo:table width="100%" text-align="left">
>> <fo:table-column
>> column-width="proportional-column-width(1)"/>
>> <fo:table-body>
>> <fo:table-row>
>> <!-- Agent name -->
>> <fo:table-cell >
>> <fo:block font-weight="bold">
>> <% if (arrAgent[j].getCustomName() != null) {
>> if (!"".equalsIgnoreCase(
>> arrAgent[j].getCustomName() )) { %>
>> <![CDATA[<%=
>> arrAgent[j].getCustomName()%>]]>
>> <% } else { %>
>> <![CDATA[<%=
>> arrAgent[j].getDisplayName()%>]]>
>> <% } %>
>> <% } else { %>
>> <![CDATA[<%=
>> arrAgent[j].getDisplayName()%>]]>
>> <% } %>
>> </fo:block>
>> </fo:table-cell>
>> </fo:table-row>
>> <fo:table-row>
>> <!-- Agent office -->
>> <fo:table-cell>
>> <fo:block>
>> <% if (arrAgent[j].getOfficeVO().getCity() !=
>> null) { %>
>> <![CDATA[<%=
>> arrAgent[j].getOfficeVO().getCity()
>> + " Office"%>]]>
>> <% } %>
>> </fo:block>
>> </fo:table-cell>
>> </fo:table-row>
>> <fo:table-row>
>> <!-- office address -->
>> <fo:table-cell>
>> <fo:block>
>> <% if (arrAgent[j].getOfficeVO().getAddress()
>> !=
>> null) { %>
>> <![CDATA[<%=
>> arrAgent[j].getOfficeVO().getAddress() %>]]>
>> <% } %>
>> </fo:block>
>> </fo:table-cell>
>> </fo:table-row>
>> <fo:table-row>
>> <!-- office city, state and zip -->
>> <fo:table-cell>
>> <fo:block>
>> <% if (arrAgent[j].getOfficeVO().getCity()
>> !=
>> null) { %>
>> <![CDATA[<%=
>> arrAgent[j].getOfficeVO().getCity()
>> + ", " %>]]>
>> <% } %>
>> <% if (arrAgent[j].getOfficeVO().getState()
>> !=
>> null ) { %>
>> <![CDATA[<%=
>> arrAgent[j].getOfficeVO().getState() + " " %>]]>
>> <% } %>
>> <% if (arrAgent[j].getOfficeVO().getZip() !=
>> null) { %>
>> <![CDATA[<%=
>> arrAgent[j].getOfficeVO().getZip()
>> %>]]>
>> <% } %>
>> </fo:block>
>> </fo:table-cell>
>> </fo:table-row>
>> <fo:table-row>
>> <!-- Agent phone -->
>> <fo:table-cell>
>> <fo:block>
>> <% if (arrAgent[j].getPhone() != null) { %>
>> <![CDATA[<%=
>> phoneFormat(arrAgent[j].getOfficeVO().getPhone()) %>]]>
>> <% } %>
>> </fo:block>
>> </fo:table-cell>
>> </fo:table-row>
>>
>> <% if ( (arrAgent[j].getEmail() != null) ) { %>
>> <fo:table-row>
>> <!-- Agent email address -->
>> <fo:table-cell>
>> <fo:block font-size="10pt">
>> <![CDATA[<%= arrAgent[j].getEmail()%>]]>
>> </fo:block>
>> </fo:table-cell>
>> </fo:table-row>
>> <% } %>
>> </fo:table-body>
>> </fo:table>
>> </fo:block>
>> </fo:table-cell>
>>
>> <fo:table-cell><fo:block></fo:block></fo:table-cell> <!--
>> prints
>> empty cell -->
>>
>> <% } %>
>>
>> <% } %>
>> </fo:table-row> <!-- end of next group of agents -->
>> </fo:table-body>
>> </fo:table>
>> </fo:block>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/How-to-center-horizontally-1-or-2-tables-within-other-table--tp20079740p20088613.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]