Closed markgif closed 8 years ago
We had the same issue and could not find a solution with CSS. We changed the output-data via a custom XSLT. Basically <entry>
-> <td>
. This breaks the merged Dita-Strucure but works for us with Prince XML. But maybe there is a better solution out there.
The template we're using:
<xsl:template match="entry">
<td xmlns="http://www.w3.org/1999/xhtml">
<xsl:copy-of select="@*"/>
<xsl:if test="@morerows">
<xsl:attribute name="rowspan" select="number(@morerows) + 1"></xsl:attribute>
</xsl:if>
<xsl:if test="@namest and @nameend">
<xsl:variable name="namest" select="@namest"/>
<xsl:variable name="nameend" select="@nameend"/>
<xsl:variable name="namestPos" select="number(parent::*/parent::*/parent::*/colspec[@colname=$namest]/@colnum)"/>
<xsl:variable name="nameendPos" select="number(parent::*/parent::*/parent::*/colspec[@colname=$nameend]/@colnum)"/>
<xsl:attribute name="colspan" select="$nameendPos - $namestPos + 1"/>
</xsl:if>
<xsl:apply-templates/>
</td>
</xsl:template>
Thanks very much. That might work for me.
What PDF processor are you using? I'm using Antenna House and I'm thinking about asking them to implement awareness of DITA/CALS @morerows etc. so I don't have to do this.
Sorry missed the processor out: I use Prince XML.
Indeed, this is a CSS limitation. There is no way to specify the column and row span of the table cells. I will integrate the fix proposed by grefel. (but I have to test it also with AntennaHouse)
I just tested with Prince and Antenna House and both have non-standard CSS extensions for imposing colspan and rowspan to table cells:
http://www.princexml.com/doc/properties/table-column-span/
*[class~="topic/entry"][colspan] {
table-column-span:attr(colspan);
}
*[class~="topic/entry"][rowspan] {
table-row-span:attr(rowspan);
}
The above XSLT template is still needed, but works fine without converting the CALS 'entry' to HTML 'td'.
I have a DITA table with spanned rows using @morerows like the sample below. The spanned rows are not respected in the PDF (attached). In searching through the CSS code I can't find "morerows" so I assume it's not implemented. How can I fix this?
Thanks, Mark
table.pdf