File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change 1616 - ** [ 6、设置列单元格格式] ( #设置列单元格格式 ) **
1717 - ** [ 7、设置行单元格格式] ( #设置行单元格格式 ) **
1818 - ** [ 8、固定内存导出] ( #固定内存导出 ) **
19+ - ** [ 9、向文件追加表格] ( #追加表格 ) **
1920
2021--------
2122
@@ -386,5 +387,38 @@ $boldStyle = \Vtiful\Kernel\Format::bold($fileHandle);
386387$fileObject->header(['name', 'age'])
387388 ->data([['viest', 21]])
388389 ->setRow($boldStyle, 'A1')
389- ->output();```
390+ ->output();
391+ ```
392+
393+ ### 追加表格
394+
395+ #### 语法
396+
397+ ``` php
398+ addSheet([string $sheetName]);
399+ ```
400+
401+ ##### 实例
402+
403+ ``` php
404+ $config = [
405+ 'path' => './filePath'
406+ ];
407+
408+ $excel = new \Vtiful\Kernel\Excel($config);
409+
410+ // 此处会自动创建一个表格
411+ $fileObject = $excel->fileName("tutorial01.xlsx");
412+
413+ $fileObject->header(['name', 'age'])
414+ ->data([['viest', 21]]);
415+
416+ // 向文件中追加一个表格
417+ $fileObject->addSheet()
418+ ->header(['name', 'age'])
419+ ->data([['wjx', 22]]);
420+
421+ // 最后的最后,输出文件
422+ $filePath = $fileObject->output();
423+ ```
390424
You can’t perform that action at this time.
0 commit comments