每行表上的MPdf botton边框

时间:2016-05-28 14:37:57

标签: php css 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;
}
        <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中的错误?

1 个答案:

答案 0 :(得分:3)

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

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

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

相关问题