使用格式将laravel Blade视图导出到Excel文件

时间:2019-03-22 17:17:09

标签: laravel eloquent maatwebsite-excel

我想使用maatwebiste将laravel刀片视图导出为ex​​cel,但是我无法放大或缩小字体大小,也无法将文本移动到居中的角度以显示效果很好,但是导出时该格式无效。

我的观点

<html>
<head>
<title>asdf</title>
<style>
    td
    {
        font-size: 72;
    }
 </style>
</head>

<body>
<table class="table" border="1" cellpadding="0px" cellspacing="0px" 
width="100%">
    <thead>
    <tr>
        <td colspan="12" style="text-align: center; background: #000000; color: #76933C; font-weight: bold;">Should be large and in center</td>
    </tr>
    <tr>
        <td>id</td>
    <td>quantity</td>
    <td>units_id</td>
    <td>description</td>
    <td>requster</td>
    <td>checker</td>
    <td>approver</td>
    <td>created_at</td>
    <td>updated_at</td>
    <td>remarks</td>
    <td>request_number</td>
    <td>steps</td>
    </tr>
    </thead>

我的出口管制员

class UsersExport implements FromView
{
public function view(): View
{
    return view('exporting', [
        'posts' => Procurment_request::all()
    ]);

}
}

0 个答案:

没有答案