How to do the phpexcel Outside Border

ABD picture ABD · Jan 4, 2015 · Viewed 43.1k times · Source

I use the below code for All Borders

$BStyle = array(
  'borders' => array(
    'allborders' => array(
      'style' => PHPExcel_Style_Border::BORDER_THIN
    )
  )
);

Here i use

$objPHPExcel->getActiveSheet()->getStyle('A8:L8')->applyFromArray($BStyle);

But How can i give the Outside Border Like the below given screen

enter image description here

Answer

Mark Baker picture Mark Baker · Jan 4, 2015

As described in the PHPExcel docs you use outline, so:

$BStyle = array(
  'borders' => array(
    'outline' => array(
      'style' => PHPExcel_Style_Border::BORDER_THIN
    )
  )
);

All the available options are shown in this illustration

This [illus