怎么样?
谢谢.
// 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);
值得注意的是,即使在将数据写入该单元格之前,也可以为单元格设置样式