This project has moved. For the latest updates, please go here.

HTML into Header

Mar 26, 2014 at 2:37 PM
i've adde some html into header and it work great with this code:
                header.XHtmlHeader(rptHeader =>
                {
                    rptHeader.PageHeaderProperties(new XHeaderBasicProperties
                    {
                        RunDirection = PdfRunDirection.LeftToRight,
                        ShowBorder = true
                    });
                    rptHeader.AddPageHeader(pageHeader =>
                    {
                        var message = "Grouping employees by department and age. <hr size='1' width='90%' align='center' />";
                        var photo = System.IO.Path.Combine(AppPath.ApplicationPath, "Images\\01.png");
                        var image = string.Format("<img src='{0}' />", photo);
                        return string.Format(@" <table style='width: 100%;font-size:9pt;font-family:tahoma;'>
                                                    <tr>
                                                        <td style='border-bottom: 1px solid #a1a1a1; border-right: 1px solid #a1a1a1'>
                                                            <div style='border:2px solid #a1a1a1; padding:50px'>
                                                                Prova
                                                            </div>
                                                        </td>
                                                        <td align='center'>test</td>
                                                        <td align='center'>test</td>
                                                    </tr>
                                                    <tr>
                                                        <td align='center'>{1}</td>
                                                        <td align='center'>{1}</td>
                                                        <td align='center'>{1}</td>
                                                    </tr>

                                                </table>", image, message);
                    });
                });
There is only one thing that isn't working ... it didn't do the rendering the borders ... how can i solve this??

Thanks
Coordinator
Mar 26, 2014 at 5:51 PM
Try
<td style='width:25%;border-bottom-width:0.2; border-bottom-color:red;border-bottom-style:solid'>Department:</td>
Border-bottom doesn't work on elements. It does work on cells. Source: http://demo.itextsupport.com/xmlworker/itextdoc/CSS-conformance-list.htm