【问题标题】:MPDF does not show table borders or anything related to table, just dataMPDF 不显示表格边框或与表格相关的任何内容,仅显示数据
【发布时间】:2019-09-24 10:31:09
【问题描述】:

我只需要最简单的解决方法,或者至少是它不起作用的原因

我已经发现 bootstrap 不适用于 MPDF,因此编写了一段最简单的常规 html 代码。但仍然没有显示任何表格。

 <?php
    require_once __DIR__ . '/vendor/autoload.php';

    $mpdf = new \Mpdf\Mpdf();

  //html variable

  $data= '<!DOCTYPE html>
  <html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial- 
    scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

  </head>
  <body>

//A Simple table
   <table >
   <thead>

   <tr>


     <th scope="col">ID</th>

   </tr>
 </thead>
 <tbody align="center">
 <tr ><td> 2413134</td><tr/>
  </tbody>
  </table>
  </body>
  </html>';


//outputing from here
$mpdf->WriteHTML($data);



$mpdf->Output();
?>

【问题讨论】:

    标签: mpdf


    【解决方案1】:

    尝试通过css添加边框:

    td {
        border: 1px solid;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-11-02
      • 2015-09-11
      • 2015-07-06
      • 2014-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多