Cannot display left or right border

Topics: Developer Forum
Aug 30, 2010 at 11:38 AM

I try to use an array to set cell format but found only A2 has left border and L2 has right border, these other cell did not left and right border but all cell can set bold and Italic.

This is my code.

$styleArray = array('font' => array('italic' => true, 'bold'=> true,    ),
'borders' => array(
'top' => array('style' => PHPExcel_Style_Border::BORDER_THIN,),
'bottom' => array('style' => PHPExcel_Style_Border::BORDER_THIN,),
'left' => array('style' => PHPExcel_Style_Border::BORDER_THIN,),
'right' => array('style' => PHPExcel_Style_Border::BORDER_THIN,),
),);

$objPHPExcel->getActiveSheet()->getStyle('A2:L2')->applyFromArray($styleArray);

Aug 30, 2010 at 3:58 PM

I found the answer, use "allborders" instead of left, right, top and borrom.