thecore7
thecore7

Reputation: 484

php how to wrap image in table with FPDF

I have this 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>';    

and php code:

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

this code output the following: enter image description here

how I can wrap the image ? img width and td width do not work obviously..

Upvotes: 0

Views: 1209

Answers (1)

thecore7
thecore7

Reputation: 484

Problem removed when changed the library to mpdf - Nice solution, which is customizable !

Upvotes: 2

Related Questions