Mar*_*ker 13
如果你自己创建所有这些表.设置您创建的第一个工作表的属性,然后克隆该工作表并将新克隆附加回同一工作簿.这应该从原始工作表中复制所有现有的单元格数据和样式信息.
// Create a new PHPExcel object with a single sheet
$objPHPExcel = new PHPExcel();
// Set any styles here against the currently active sheet in $objPHPExcel
// Get the current sheet with all its newly-set style properties
$objWorkSheetBase = $objPHPExcel->getSheet();
// Create a clone of the current sheet, with all its style properties
$objWorkSheet1 = clone $objWorkSheetBase;
// Set the newly-cloned sheet title
$objWorkSheet1->setTitle('Cloned Sheet');
// Attach the newly-cloned sheet to the $objPHPExcel workbook
$objPHPExcel->addSheet($objWorkSheet1);
Run Code Online (Sandbox Code Playgroud)
值得注意的是,即使在将数据写入该单元格之前,也可以为单元格设置样式
| 归档时间: |
|
| 查看次数: |
6999 次 |
| 最近记录: |