Text size

Function Prototype

1
fontSize(double $size);
Copied!

double $size

cell font size

Example

1
$config = [
2
'path' => './tests'
3
];
4
5
$fileObject = new \Vtiful\Kernel\Excel($config);
6
$fileObject = $fileObject->fileName('tutorial.xlsx');
7
$fileHandle = $fileObject->getHandle();
8
9
// Create a style resource
10
$format = new \Vtiful\Kernel\Format($fileHandle);
11
$style = $format->fontSize(30)->toResource();
12
13
$filePath = $fileObject->header(['name', 'age'])
14
->data([
15
['viest', 21],
16
['wjx', 21]
17
])
18
->setRow('A1', 50, $style) // Apply style
19
->setRow('A2:A3', 50, $style) // Apply style
20
->output();
Copied!
Last modified 2yr ago