【问题标题】:MPdf botton border on every row table每行表上的 Mpdf 底部边框
【发布时间】:2016-09-26 18:50:15
【问题描述】:

我正在制作一个 Wordpress 模块来预订房间。 现在我使用 mPDF 自动创建预订合同。

mPDF 在创建每行都有边框线的表格时存在问题。 当我创建表格并在 html 中查看它时,一切看起来都很好。但是当我使用 mPDF 创建 PDF 时,不会显示行底部边框。

这是我用来生成 pdf 的 html 代码:

.logo
{
    display: inline-block;
    width: 130;
    height: 146;
    align: left;
    hspace: 12;
}

.headerText
{
    display:inline-block;
    text-align: right;
    float:right;
}

.header{
    padding-bottom: 20px;
}

.table{
    border-left: thin solid;
    border-right: thin solid;
    border-bottom: thin solid #000000;
    border-top: thin solid;
}

.table{
    margin-top: 10px;
    margin-bottom: 10px;
    border-collapse: collapse;
}

table tr {
    border-bottom: 1px solid black;
}

table tr:last-child { 
    border-bottom: none; 
}

.Cell
{

    width: 300px;
}

.firstCell
{
    border-left: thin;
    border-right: thin solid;
    border-bottom: thin;
    border-top: thin;
}

.smallCell
{
    width:150px;
}

.largeCell
{
    width: 450px;
}

.row
{
    display: block;
}

.koninklijkeLogo
{
    width: 30px;
}

.maxSize
{
    width: 600px;
}
        <table class="table">
            <tr class="row">
                <td class="smallCell firstCell">Naam:</td>
                <td class="largeCell">{%name%}</td>
            </tr>
            <tr class="row">
                <td class="smallCell firstCell">Adres:</td>
                <td class="largeCell">{%adres%}</td>
            </tr>
            <tr class="row">
                <td class="smallCell firstCell">Telefoonnummer:</td>
                <td class="largeCell">{%phone%}</td>
            </tr>
            <tr class="row">
                <td class="smallCell firstCell">E-mailadres:</td>
                <td class="largeCell">{%mail%}</td>
            </tr>
        </table>

我可以通过更改我的一些代码来解决问题吗?或者这是 mPDF 中的错误?

【问题讨论】:

    标签: php css wordpress html-table mpdf


    【解决方案1】:

    this document 开始,最新版本的mPDF(版本6)似乎支持tr 元素的边框。

    1. 您使用的是最新版本吗?

    2. 也许您可以尝试仅对单元格而不是行应用底部边框? (只要确保没有表格单元格间距或td 单元格边距,否则您会在边框中看到间隙)。

    【讨论】:

    • 唯一的解决方案是第二种,虽然在文档中说它受支持
    猜你喜欢
    • 2012-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-29
    • 2012-02-17
    相关资源
    最近更新 更多