This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Column widths


Thanks for all help with my last problem. Today I got a problem with column
widths. I use the XHTML table model, and this is in the <td> and <th>
templates:

<xsl:variable name="x" select="position()"/>
...
<xsl:if test="ancestor::table//col[$x]/attribute::width">
  <xsl:attribute name="width">
    <xsl:value-of select="ancestor::table//col[$x]/attribute::width"/>
  </xsl:attribute>
</xsl:if>

I try to add a width attribute to <fo:table-cell> here, but what happens is
that I get the first column's width on every cell, except the last which
gets no width attribute at all.

XPath seem to suggest a syntax with [ and ] for attributes, like
ancestor::table//col[$x][attribute::width]. I tried that too, but then all
width attributes was empty (except the last which has no attribute).

Gustaf


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]