$config = [
'path' => './tests'
];
$excel = new \Vtiful\Kernel\Excel($config);
$fileObject = $excel->fileName('tutorial.xlsx');
$fileHandle = $fileObject->getHandle();
// 四边同色
$singleColor = (new \Vtiful\Kernel\Format($fileHandle))
->border(\Vtiful\Kernel\Format::BORDER_THIN)
->borderColor(\Vtiful\Kernel\Format::COLOR_RED)
->toResource();
// 四边不同色
$mixedColor = (new \Vtiful\Kernel\Format($fileHandle))
->borderOfTheFourSides(
\Vtiful\Kernel\Format::BORDER_THIN,
\Vtiful\Kernel\Format::BORDER_THIN,
\Vtiful\Kernel\Format::BORDER_THIN,
\Vtiful\Kernel\Format::BORDER_THIN
)
->borderColorOfTheFourSides(
\Vtiful\Kernel\Format::COLOR_RED,
\Vtiful\Kernel\Format::COLOR_GREEN,
\Vtiful\Kernel\Format::COLOR_BLUE,
\Vtiful\Kernel\Format::COLOR_YELLOW
)
->toResource();
$fileObject->header(['name', 'score'])
->setRow('A1', 20, $singleColor)
->setRow('A2', 20, $mixedColor)
->output();