【问题标题】:iText's XmlWorker does not recognize border-bottom on table celliText 的 XmlWorker 无法识别表格单元格上的边框底部
【发布时间】:2014-12-16 15:54:07
【问题描述】:

XmlWorker 无法识别表格单元格的边框底部。

这是我的代码:

<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>

我正在使用这个官方工具进行测试:
http://demo.itextsupport.com/xmlworker/ (点击“html”按钮,在“字体大小”下,粘贴代码)

我也在使用 iTextSharp + MvcRazorToPdf(两个 C# 库)进行测试。

问题:
我怎样才能让边框底部工作?

编辑:
根据此兼容性摘要:http://demo.itextsupport.com/xmlworker/itextdoc/CSS-conformance-list.htm,css 属性 border-bottom 应该可以与 html 元素 td (cell) 一起正常工作

【问题讨论】:

    标签: itextsharp itext xmlworker mvcrazortopdf


    【解决方案1】:

    XMLWorker 不支持在大小写特定边框样式中使用简写 CSS 属性。应该支持全局属性“border”。它看起来像是一致性列表中的错字。 请改用属性全名: &lt;td style="... border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: gray" ...&gt;

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-05-27
    • 1970-01-01
    • 1970-01-01
    • 2013-02-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多