码迷,mamicode.com
首页 > Web开发 > 详细

还是PHPExcel问题

时间:2015-06-15 23:36:26      阅读:778      评论:0      收藏:0      [点我收藏+]

标签:

 

//设置自动设置宽度,但是对中文不起作用。。(中文自动长还在研究当中)

$objPHPExcel->getActiveSheet()->getColumnDimension(‘A‘)->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getColumnDimension(‘B‘)->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getColumnDimension(‘C‘)->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getColumnDimension(‘D‘)->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getColumnDimension(‘E‘)->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getColumnDimension(‘F‘)->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getColumnDimension(‘G‘)->setAutoSize(true);
//设置左右居中
$objPHPExcel->getActiveSheet()->getStyle(‘A1:K55‘)
->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);

//设置边框线
$objPHPExcel->getActiveSheet()->getStyle(
‘A2:K100‘
)->getBorders()->getAllBorders()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);

还是PHPExcel问题

标签:

原文地址:http://www.cnblogs.com/xiaocongjiejie/p/4579445.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!