【问题标题】:php how to wrap image in table with FPDFphp如何使用FPDF将图像包装在表格中
【发布时间】:2023-04-03 09:42:01
【问题描述】:

我有这个 html

$html='<table width="100%" class="p" id="tblExport"><tbody>
    <tr><th>#</th><th>product</th><th>picture</th><th>product_category</th><th>avl_qty</th><th>promo_price</th><th>price</th></tr>    
<tr><td width="20" height="50">1</td><td width="250" height="50" class="left">Ladies bracelet SB25413</td><td width="80" height="50"><img width="60" src="../images/products/small/Ladies-bracelet-774-1.jpg"></td><td width="250" class="left">Leather bracelets</td><td width="150" height="50">3 br</td><td></td><td>37.00eur</td></tr>
<tr><td width="20" height="50">2</td><td width="250" height="50" class="left">Ladies bracelet SB20257</td><td width="80" height="50"><img width="60" src="../images/products/small/Ladies-bracelet-775-1.jpg"></td><td width="250" class="left">Bracelets with crystals</td><td width="150" height="50">32 br</td><td>15.00 eur</td><td>34.00eur</td></tr></tbody></table>';    

和php代码:

require('html_table.php');
$pdf=new PDF();
$pdf->AddPage();
$pdf->SetFont('Arial','',12);
$pdf->WriteHTML($html);
$pdf->Output();    

此代码输出以下内容:

如何包装图像? img 宽度和 td 宽度显然不起作用..

【问题讨论】:

    标签: php html css pdf fpdf


    【解决方案1】:

    将库更改为 mpdf 时问题已消除 - 很好的解决方案,可自定义!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-07
      • 1970-01-01
      • 1970-01-01
      • 2018-10-01
      • 2023-01-20
      相关资源
      最近更新 更多