[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Text overflow in table cells
Hi! If a table cell (in pdf) has a text token longer than fits in the said cell, I'd like to truncate the content instead of overflowing it over the contents of the next cell as seems to be the default. Here's a (somewhat) minimal sample: <article> <title>Overflow sample</title> <informaltable frame="none" colsep="0" rowsep="0"> <tgroup cols="10"> <colspec colname="1" align="left"/> <colspec colname="2" align="left"/> <colspec colname="3" align="left"/> <colspec colname="4" align="left"/> <colspec colname="5" align="right"/> <colspec colname="6" align="right"/> <colspec colname="7" align="right"/> <colspec colname="8" align="right"/> <colspec colname="9" align="left"/> <colspec colname="10" align="right"/> <tbody> <row> <entry>PARTIALSUBDRAUGHT/TEST</entry> <entry>INTACT</entry> <entry>EQ</entry> <entry>PS</entry> <entry>7.040</entry> <entry>0.000</entry> <entry>0.0</entry> <entry>-</entry> <entry>-</entry> <entry>1.01</entry> </row> </tbody> </tgroup> </informaltable> </article> The token "PARTIALSUBDRAUGHT" overflows into the next cell on the top of the text there - this looks messy. I know truncating the string and thus losing content is not a good thing either, but due to user demand I'd like to be able to do that. In this particular case the problem could be solved by resizing the columns appropriately, but all the cases are not that simple. Using hyphenation is not (always) an option either since some of the texts (like the one above) are identifiers and no extra "-" should be inserted. Looking at documentation for <entry> (docbook table cell) I found nothing suitable. Did I miss something? I found this in fop faq: http://xmlgraphics.apache.org/fop/faq.html#cells-overflow Trying this out, I manually edited the xsl-fo and achieved what I wanted. I.e. I wrapped the <fo:block> inside <fo:table-cell> inside a <fo:block-container> like this: <fo:table-cell padding-left="2pt" padding-right="2pt" padding-top="2pt" padding-bottom="2pt" text-align="left"> <fo:block-container overflow="hidden"> <fo:block>PARTIALSUBDRAUGHT/TEST</fo:block> </fo:block-container> </fo:table-cell> Now comes the problem: I went through docbook-xsl customization options for table cells and found table.cell.properties and table.cell.block.properties, but they don't help me as it's not sufficient to set an attribute value. I hope I'm wrong, but it seems that the only way to achieve what I want is to hack "entry" template in fo/table.xsl (around lines 1022-1038). Also, as this behavior should be optinal, I should use role or style attribute something like role="truncate-overflow". Any better ideas? Environment: win xp sp 2 docbook xsl 1.74.0 saxon 9.1.0.3 java 1.6.0_11 fop 0.95 adobe reader 9.0.0 ::Antti::
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]