Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iText's XmlWorker does not recognize border-bottom on table cell

XmlWorker does not recognize border-bottom on table cell.

This is my code:

<table>
    <tbody>
        <tr>
            <th style="width: 20%; height: 40px; vertical-align: top; border-bottom: 1px solid gray">Your name</th>
            <td style="width: 80%; border-bottom: 1px solid gray"></td>
        </tr>
        <tr>
            <th style="height: 40px; vertical-align: top; border-bottom: 1px solid gray">Your lastname</th>
            <td style="border-bottom: 1px solid gray"></td>
        </tr>
    </tbody>
</table>

I'm testing using this official tool:
http://demo.itextsupport.com/xmlworker/ (Click "html" button, under "font size", and paste code)

I'm also testing using iTextSharp + MvcRazorToPdf (two C# libraries).

Question:
How can I get the border-bottom to work?

Edit:
Acording to this compatibility summary: http://demo.itextsupport.com/xmlworker/itextdoc/CSS-conformance-list.htm, the css property border-bottom should work fine with the html element td (cell)

like image 364
sports Avatar asked Dec 16 '14 15:12

sports


1 Answers

XMLWorker does not support for shorthand CSS properties in case side specific border styles. The global property "border" should be supported. It looks like a typo in the conformance list. Please use the property full names instead: <td style="... border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: gray" ...>

like image 131
Eugene Markovskyi Avatar answered Nov 16 '22 12:11

Eugene Markovskyi