I have a table in my Database containing the data of many items with the name of its image.
From that table I want to display each item data with its image. This is the code I use to display it in PHP:
<table>
<thead>
<tr>
<th style="border-width:medium;" rowspan="2">CODE</th>
<th style="border:medium;" rowspan="2">CLR</th>
<th style="border-width:medium;" rowspan="2">IMAGE</th>
<th style="border-width:medium;" rowspan="2">DESCRIPTION</th>
<th style="border-width:medium;" rowspan="2">QTY.</th>
<th style="border-width:medium;" rowspan="2">PRICE</th>
</tr>
</thead>
<tbody>
<?php foreach($list as $data){?>
<tr>
<td><?=$data->code_caption?></td>
<td style="text-align:center"><?=$data->color?></td>
<td style="width:135px; height:135px; text-align:center;">
<img src="<?=base_url().'media/img/gallery/items/'.$data->image?>TH.jpg" style="margin:5px; text-align:center; vertical-align:middle;" />
</td>
<td><?=$data->desc?></td>
<td style="text-align:center"><?=$data->qty?></td>
<td style="text-align:right"><?=$data->price?></td>
</tr>
<?php }?>
</tbody>
</table>
I want to export the data to an Excel formatted file so it looks like what I display on my PHP page.
Can it be done?
I have tried to use the Excel header but the image becomes a link, it's not the complete image being embedded.
And I also saw the PHPexcel library, but I cannot find a way to write the loop with the image.
Any solution for my problem will be very helpful.
Thanks for Helping me I have found the answer for my own question.