Thanks ken.Thank you very much for your nice reply
It tried your code snippet and it worked fine
Cheers
George
-----Original Message-----
From: G. Ken Holman [mailto:gkholman(_at_)CraneSoftwrights(_dot_)com]
Sent: Monday, September 20, 2004 4:14 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] problem with table
At 2004-09-20 15:21 +0530, Eldho George wrote:
I have some problem with <fo:table-column>.Suppose i am using different
table structure such as
first <tr> contains 3 <td>.Second <tr> contains 4 <td>.Then 3<tr> onwards
it
contains 6 <td>
The following is my table template.
<xsl:for-each select="tr/th|tr/td|thead/tr/th|thead/tr/td">
<fo:table-column/>
</xsl:for-each>
This would obtain *every* th and *every* td and give you one table column
per item, which is why you are getting so many columns.
Remember that all rows in an XSL-FO table will render with the same number
of columns and the column edges will be the same for all rows in a single
table.
Thus, you need only traverse the maximum number of columns. The maximum
number of columns can be obtained by sorting the rows by the number of
columns, sorting them in descending order, and acting on the first of those:
<xsl:for-each select="tr|thead/tr">
<xsl:sort select="count(td|th)" data-type="number"
order="descending"/>
<xsl:if test="position()=1">
<xsl:for-each select="td|th">
<table-column/>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
I hope this helps.
............................ Ken
--
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers: http://www.CraneSoftwrights.com/legal
--+------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************