Insert text

insertText(int $row, int $column, string|int|double $data[, string $format, resource $formatHandler])

cell row

cell column

What needs to be written

Content format

cell style

$excel = new \Vtiful\Kernel\Excel($config);
$textFile = $excel->fileName("free.xlsx")
->header(['name', 'money']);
for ($index = 0; $index < 10; $index++) {
$textFile->insertText($index+1, 0, 'viest');
$textFile->insertText($index+1, 1, 10000, '#,##0'); // #,##0 is the cell data style
}
$textFile->output();

For more styles, please refer to the Excel Microsoft documentation.
"0.000"
"#,##0"
"#,##0.00"
"0.00"
"0 \"dollar and\" .00 \"cents\""
Last modified 2yr ago
Copy link
On this page
Function Prototype
int $row
int $column
string | int | double $data
string $format
resource $formatHandler
example
Digital Style Example