31

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

ABD
  • 869
  • 2
  • 12
  • 28

1 Answers1

100

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

Mark Baker
  • 209,507
  • 32
  • 346
  • 385
  • outline not works proper for merged cell.any reason for that? – Alfiza malek Mar 31 '20 at 10:46
  • @ mark outline not works proper for merged cell.any reason for that? I also add question https://stackoverflow.com/questions/60983946/outline-border-not-working-in-laravel-excel – Alfiza malek Apr 04 '20 at 12:50