Bug 1724 - Text alignment in table cells
Summary: Text alignment in table cells
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: all
Hardware: PC All
: P1 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
: 1723 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-05-11 10:55 UTC by Joy Andree
Modified: 2012-04-01 06:28 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joy Andree 2001-05-11 10:55:49 UTC
FOP 0.18.1 - default text alignment is left - 1.37 Docbook - Norm Walsh style 
sheet
PDF file viewed in Acrobat Reader and Ghostview. 

(1)Text align right attribute does not work in table cells. The text will align 
center in the cells but not right align.  See xml source files and .fo output 
below.
 
(2)Table column align does not work for alignment of text in table cells.
    See example tgroup below.


XML source

<table>
<title>Test table 1</title>
<tgroup cols="3"><colspec colname="col1" colwidth="2.0in"/><colspec 
colname="col2"
colwidth="2.0in"/><colspec colname="col3" colwidth="2.0in"/><tbody><row>
<entry colname="col1" colsep="1" rowsep="1" align="right">colwidth=2in</entry>
<entry colname="col2" colsep="1" rowsep="1" align="left">colwidth=2in</entry>
<entry colname="col3" colsep="1" rowsep="1" align="center">colwidth=2in</entry>
</row><row>
<entry colname="col1" colsep="1" rowsep="1" align="right">cell text align
right</entry>
<entry colname="col2" colsep="1" rowsep="1" align="left">cell text align 
left</entry>
<entry colname="col3" colsep="1" rowsep="1" align="center">cell text align
center</entry>
</row></tbody></tgroup>
</table>


.fo output files

<fo:table-and-caption id="N2544" keep-together.within-column="always" space-
before.minimum="0.8em" space-before.optimum="1em" space-before.maximum="1.2em" 
space-after.minimum="0.5em" space-after.optimum="0.8em" space-
after.maximum="1.0em">
<fo:table-caption>
<fo:block font-weight="bold" keep-with-next.within-column="always" 
hyphenate="false">Test table 1</fo:block>
</fo:table-caption>
<fo:table space-before.minimum="0.5em" space-before.optimum=".8em" space-
before.maximum="1em" space-after.minimum="0.8em" space-after.optimum="1em" 
space-after.maximum="1.2em">
<fo:table-column column-number="1" column-width="2.0in"/>
<fo:table-column column-number="2" column-width="2.0in"/>
<fo:table-column column-number="3" column-width="2.0in"/>
<fo:table-body border-left="0.5pt solid red " padding-left="0pt" border-
right="0.5pt solid red " padding-right="0pt" border-top="0.5pt solid red " 
padding-top="0pt" border-bottom="0.5pt solid red " padding-bottom="0pt">
<fo:table-row>
<fo:table-cell border-right="0.5pt solid red " padding-right="0pt" border-
bottom="0.5pt solid red " padding-bottom="0pt">
<fo:block start-indent="5pt" end-indent="5pt" text-
align="right">colwidth=2in</fo:block>
</fo:table-cell>
<fo:table-cell border-right="0.5pt solid red " padding-right="0pt" border-
bottom="0.5pt solid red " padding-bottom="0pt">
<fo:block start-indent="5pt" end-indent="5pt" text-
align="left">colwidth=2in</fo:block>
</fo:table-cell>
<fo:table-cell border-right="0.5pt solid red " padding-right="0pt" border-
bottom="0.5pt solid red " padding-bottom="0pt">
<fo:block start-indent="5pt" end-indent="5pt" text-
align="center">colwidth=2in</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border-right="0.5pt solid red " padding-right="0pt" border-
bottom="0.5pt solid red " padding-bottom="0pt">
<fo:block start-indent="5pt" end-indent="5pt" text-align="right">cell text align
right</fo:block>
</fo:table-cell>
<fo:table-cell border-right="0.5pt solid red " padding-right="0pt" border-
bottom="0.5pt solid red " padding-bottom="0pt">
<fo:block start-indent="5pt" end-indent="5pt" text-align="left">cell text align 
left</fo:block>
</fo:table-cell>
<fo:table-cell border-right="0.5pt solid red " padding-right="0pt" border-
bottom="0.5pt solid red " padding-bottom="0pt">
<fo:block start-indent="5pt" end-indent="5pt" text-align="center">cell text 
align
center</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-and-caption>


Also text alignment attribute for table-column does not follow through and 
align the table cells text.

XML source - example tgroup

<tgroup cols="3"><colspec colname="col1" colwidth="2.0in" align="right"/>
<colspec colname="col2" colwidth="2.0in" align="left"/><colspec colname="col3"
colwidth="2.0in" align="center"/>
Comment 1 klease 2001-05-16 14:58:27 UTC
left and right are not legal values for the text-align property. Use "start" and
"end". After this change, the FO works in current CVS.
Also the table-and-caption FO isn't yet implemented.
Comment 2 klease 2001-05-16 14:59:11 UTC
*** Bug 1723 has been marked as a duplicate of this bug. ***
Comment 3 Joy Andree 2001-05-18 08:19:13 UTC
See 5.4.3 of the XSL FO spec:

  5.4.3 Text-align Property

  A value of "left", or "right" is converted to the writing-mode
  relative value as specified in the property definition.

Comment 4 Joy Andree 2001-05-18 08:26:54 UTC
I forgot to add this warning message I also get when I process the file.
WARNING: Unknown enumerated value for property 'text-align': left
Error in text-align property value 'left': 
org.apache.fop.fo.expr.PropertyException: No conversion defined
Comment 5 klease 2001-09-21 14:58:16 UTC
The keywords left and right now (CVS 0.20.1+) work for text-align (on any block
FO).
Concerning the second issue, there is no direct inheritance from table-columns.
You must use the from-table-column function (XSL 5.10.4), but that doesn't yet
work in FOP.
Comment 6 Oleg Tkachenko 2002-11-14 20:49:55 UTC
Well, "left" and "right" values of text-align work, I believe I can close the bug.
Comment 7 Glenn Adams 2012-04-01 06:28:25 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed