I have try to generate PDF from HTML using FOP. My problem is background color in not working for Table. My html code is
<table cols="100 100pt" border="1" width="100%" align="center">
<thead>
<tr>
<th style="background-color: blue"><span style="color: blue">col 1</span></th>
<th style="background-color: #ffffff">col 2</th>
</thead>
<tbody>
<tr>
<td style="background-color: #ffffff">value 1</td>
<td>Value 2</td>
</tr>
</tbody>
</table>
and my xsl code is
<xsl:template match="table">
<fo:table table-layout="fixed">
<xsl:choose>
<xsl:when test="@cols">
<xsl:call-template name="build-columns">
<xsl:with-param name="cols"
select="concat(@cols, ' ')" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<fo:table-column column-width="200pt" />
</xsl:otherwise>
</xsl:choose>
<fo:table-body>
<xsl:apply-templates select="*" />
</fo:table-body>
</fo:table>
</xsl:template>
<xsl:template match="td">
<fo:table-cell>
<fo:block text-align="{$align}">
<xsl:apply-templates select="*|text()"/>
</fo:block>
</fo:table-cell>
</xsl:template>
Can any one know how to add back ground color for table in PDF?