设置列单元格格式
函数原型
- setColumn(string $range, double $width [, resource $format]);
string $range
单元格范围
double $width
单元格宽度
string $format
单元格样式
实例
- $config = ['path' => './tests'];
- $excel = new \Vtiful\Kernel\Excel($config);
- $fileObject = $excel->fileName('tutorial01.xlsx');
- $fileHandle = $fileObject->getHandle();
- $format = new \Vtiful\Kernel\Format($fileHandle);
- $boldStyle = $format->bold()->toResource();
- $fileObject->header(['name', 'age'])
- ->data([['viest', 21]])
- ->setColumn('A:A', 200, $boldStyle)
- ->output();