2016-08-10 59 views
1

我旁邊有簡單的模板:如何刪除maatwebsite-excel(Laravel Excel)生成的右列?

<!doctype html> 
<html> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <style> 
     * { 
      font-family: DejaVu Sans, sans-serif; 
      font-size: 10pt; 
     } 
     table.data td { 
      border: 1px solid #f44; 
     } 
     table, table td { 
      border: 0px dotted #88ff88; 
      width: 0px; 
      visibility: hidden; 
     } 
    </style> 
</head> 
<body> 
    <table class="data"> 
     <thead> 
      <tr> 
       <td>cell 1</td> 
       <td>cell 2</td> 
      </tr> 
      <tr> 
       <td>cell 3</td> 
       <td>cell 4</td> 
      </tr> 
      <tr> 
       <td>cell 5</td> 
       <td>cell 6</td> 
      </tr> 
     </thead> 
    </table> 
</body> 

而且我店使用Laravel Excel和DOMPDF驅動程序生成的文件轉換爲PDF。

Excel::create('test', function($excel) use ($data, $reportProperties) 
{ 
    $excel->sheet('Report', function($sheet) 
    { 
     $sheet->setOrientation('portrait'); 
     $sheet->loadView('export.activity'); 
    }); 
})->store('pdf'); 

我也得到一個結果:

enter image description here

我的問題是如何去除右列?

回答

0

我解決了使用barryvdh/laravel-dompdf包裝問題,而中間件maatwebsite-excel

App::make('dompdf.wrapper') 
    ->loadView('export.activity') 
    ->save($fileName);