phpexcel设置所有单元格的默认对齐方式

代码如下,从国外论坛上找到的

$objPHPExcel->getDefaultStyle()->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getDefaultStyle()->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);

 

方法来自:http://stackoverflow.com/questions/12614864/phpexcel-how-to-apply-alignment-for-the-whole-document-created-from-mysql-table

转载于:https://www.cnblogs.com/shanmao/p/3276855.html

你可能感兴趣的:(phpexcel设置所有单元格的默认对齐方式)