为什么没有边框设置phpexcel

时间:2017-08-23 01:26:08

标签: php phpexcel

$objPHPExcel->getActiveSheet()->setCellValue('A1', "No");
$objPHPExcel->getActiveSheet()->setCellValue('B1', "Roc No");
$objPHPExcel->getActiveSheet()->setCellValue('C1', "Company Name");
$objPHPExcel->getActiveSheet()->setCellValue('D1', "Address");
$objPHPExcel->getActiveSheet()->setCellValue('E1', "Phone No");
$objPHPExcel->getActiveSheet()->setCellValue('F1', "Fax No");
$objPHPExcel->getActiveSheet()->setCellValue('G1', "Email");
$objPHPExcel->getActiveSheet()->setCellValue('H1', "Preqpoint");
$objPHPExcel->getActiveSheet()->setCellValue('I1', "Preqstatus");

$styleArray = array('borders' => array('allborders' => array('style' => PHPExcel_Style_Border::BORDER_THIN,'color' => array('argb' => '000000'),),),);
$objPHPExcel->getActiveSheet()->getStyle('A1:I1')->applyFromArray($styleArray);
$objPHPExcel->getActiveSheet()->getStyle('A1:I1')->getBorders()->getAllBorders()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN)->getColor()->setRGB('000000');

我尝试使用此代码在单元格周围添加边框,但我不知道为什么它不起作用而且我的英文不好

0 个答案:

没有答案