将带有图像的刀片导出到Excel

时间:2015-10-21 09:35:39

标签: php excel laravel-4

使用Laravel Excel我尝试将带有图像的刀片导出到Excel。图像进入Excel,但我无法设置其位置。图像显示在单元格的中心,我需要在左侧。我尝试了边距和宽度,但这不起作用。这是我的刀片:

<html>
    <?php $path = public_path(); ?>
    <table> 
    <tr>
        <td align="center" valign="middle" height="50">
            <strong>
                {{$title}}
            </strong>
        </td>
    </tr>
    <tr>
        <td>
            <img src="{{$path}}/pieCharts/abc.png" />
        </td>
    </tr>
    </table>
</html>

这是我的代码:

    App:: make('excel');
    Excel::create($title, function($excel) use ($month_name, $year, $hd) 
    {
        $title = $hd.' '.$month_name.' '.$year;

        $excel->sheet('Pie Chart', function($sheet) use ($title) 
        {
            $sheet->loadView('utilityPieChart')->with('title', $title);
        });    

    })->download('xls');

我们可以将位置应用于图像吗?

0 个答案:

没有答案
相关问题