还是PHPExcel问题

 

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

$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);

posted on 2015-06-15 22:58  小葱杰杰  阅读(379)  评论(0编辑  收藏  举报

导航