【发布时间】: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