2014-03-26 48 views
0

我有這個網站PHP如何包裝圖像表FPDF

$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();  

這段代碼的輸出如下: enter image description here

如何我可以換圖片 ? img寬度和TD寬度不工作明顯..

回答

2

將庫更改爲mpdf時刪除的問題 - 很好的解決方案,這是可定製的!