php - 每行表上的 MPdf 按钮边框

标签 php css wordpress html-table mpdf

我正在制作一个 Wordpress 模块来预订房间。 现在我使用 mPDF 自动创建预订契约(Contract)。

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 中的一个错误?

最佳答案

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

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

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

关于php - 每行表上的 MPdf 按钮边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37500276/

相关文章:

javascript - 使用 jQuery 设置随机值的字体大小?

php - 在 Wordpress 中使用 ajax 提交表单

javascript - woocommerce 产品图片不循环显示

javascript - 隐藏 iFrame 源

php - 如何使用带有连接表的 mysqli 删除查询

javascript - 代码警报 'object Object'

TH 标签中工具提示的 CSS 样式

css - 在css中引用多个单词

javascript - 使用自定义 JavaScript、WordPress 更改页脚区域中图像的 href

php - 我该如何解决 "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"?