每行表格的 MPdf 按钮边框

3
我正在制作一个 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的一个bug?

1个回答

5

根据这个文档,最新版本的mPDF(版本6)支持为tr元素添加边框。

  1. 请问您正在使用最新版本吗?

  2. 您可以尝试仅为单元格应用底部边框而不是整行边框(请确保表格没有设置cellspacing或td单元格边距,否则会出现边框间隙)。


1
唯一的解决方案是第二个,尽管文档中说它得到了支持。 - JesuLopez

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接