问题描述
这是我的代码:
$htmls ='<html><body style="font-size:100px;">
<table style="width:100%;border-spacing: 0px; margin-top: 10px;background-color: #FF5733;font-size:100px;" >
<tr>
<td style="padding: 5px 8px; font-weight: bold;">TEST</td>
<td style="padding: 5px 8px;"> Test1 </td>
<td style="padding: 5px 8px;"> Test2 </td>
</tr>
</table></body></html>';
require './mpdf60/mpdf.PHP';
$mpdf = new mPDF('utf-8','A4',1);
$mpdf->SetdisplayMode('fullpage');
$mpdf->autoLangToFont = true;
$mpdf->autoScriptToLang = true;
$mpdf->useSubstitutions = false;
$mpdf->simpleTables = true;
$mpdf->packTableData = true;
$mpdf->showImageErrors = true;
$mpdf->list_indent_first_level = 0;
$mpdf->WriteHTML($html);
$fname = date('Y-m-d-h-i-s') . ".pdf";
$mpdf->Output(__DIR__ . "/pdf/" . $fname);
$filePath =__DIR__ . "/pdf/" . $fname;
输出:
我需要它。
如何修复它。创建css
文件对我来说很困难,因为我在所有标签上使用了不同的样式。