每行表上的 MPdf 底部边框

Jim*_*myD 3 css php wordpress html-table mpdf

我正在制作一个 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;
}
Run Code Online (Sandbox Code Playgroud)
        <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>
Run Code Online (Sandbox Code Playgroud)

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

Ste*_*fan 5

该文档tr来看,最新版本的 mPDF(版本 6)似乎支持元素 边框。

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

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