fileName_demo.php 428 B

12345678910111213
  1. <?php
  2. require_once(__DIR__ . '/../vendor/autoload.php');
  3. use Pxlswrite\Pxlswrite;
  4. $fileObj = new Pxlswrite(['path' => __DIR__ . '/uploads']);
  5. $fileObj->fileName('filename.xlsx');
  6. $fileObj
  7. ->header(['name', 'age'])
  8. ->data([['viest', 21]])
  9. ->setRow('A1', 50, ['bold'=>true,'align'=>[Pxlswrite::FORMAT_ALIGN_CENTER,Pxlswrite::FORMAT_ALIGN_VERTICAL_CENTER]]) // 可以在写入数据后设置行样式
  10. ->output();