Wrap table column content

G

Guru

Hi,

I am using FOP for creating pdf.
I am having a table which has 14 columns.
And each column contents may contain any
number of chars.

My problem is :
When the text is having no spaces in between like
"thisisalongwordandcouldnotbewrapped", it is overlapping
another column. How to wrap the text with in the cell.??

I used wrap-option="wrap" overflow="auto", but no luck.
Is there any solutions for this?

Guru.
 
G

Guru

Finally i solved the problem
by inserting zero width white spaces at regular intervals.
Thanks to FOP mailing list..!


<xsl:call-template name="text_wrapper"> <xsl:with-param
name="Text" select="$myString"/>
</xsl:call-template>


===Templates used to do the task.
<xsl:template name="text_wrapper">
<xsl:param name="Text"/>
<xsl:choose>
<xsl:when test="string-length($Text)">
<xsl:value-of select="substring($Text,1,25)"/>

<xsl:call-template name="wrapper_helper">
<xsl:with-param name="Text" select="substring($Text,26)"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="wrapper_helper">
<xsl:param name="Text"/>
<xsl:value-of select="substring($Text,1,25)"/>

<xsl:call-template name="text_wrapper">
<xsl:with-param name="Text" select="substring($Text,26)"/>
</xsl:call-template>
</xsl:template>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top