1
當我使用以下樣式時,一切正常。TCPDF - 內部css無效
<style>
table{
border: 0.5px solid black;
border-collapse: separate;
border-spacing: 0;
}
</style>
但是當我使用類,代碼不工作。
<style>
.tableWithOuterBorder{
border: 0.5px solid black;
border-collapse: separate;
border-spacing: 0;
}
</style>
以下是我的詳細代碼。
$htmlData = "<html><head>";
$htmlData .= "<style>
.tableWithOuterBorder{
border: 0.5px solid black;
border-collapse: separate;
border-spacing: 0;
}
</style>";
$htmlData .= "</head><body>";
$htmlData .= "<table class='tableWithOuterBorder'><tr><td>Hello</td><td>Sir</td></tr></table>";
$htmlData .= "</body></html>";
$pdf->writeHTML($htmlData, true, false, false, false, '');
我的代碼有什麼問題?
使用inline-css代替內部的css –