设置列单元格格式

函数原型

  1. setColumn(string $range, double $width [, resource $format]);

string $range

单元格范围

double $width

单元格宽度

string $format

单元格样式

实例

  1. $config = ['path' => './tests'];
  2. $excel = new \Vtiful\Kernel\Excel($config);
  3.  
  4. $fileObject = $excel->fileName('tutorial01.xlsx');
  5. $fileHandle = $fileObject->getHandle();
  6.  
  7. $format = new \Vtiful\Kernel\Format($fileHandle);
  8. $boldStyle = $format->bold()->toResource();
  9.  
  10. $fileObject->header(['name', 'age'])
  11. ->data([['viest', 21]])
  12. ->setColumn('A:A', 200, $boldStyle)
  13. ->output();