Reputation: 1322
in phpexcel how do i remove the middle border line between 2 cells?
like this pic:
it currently shows as:
this is my current code:
$styleArray = array(
'borders' => array(
'allborders' => array(
'style' => PHPExcel_Style_Border::BORDER_DOUBLE
)
)
);
$objPHPExcel->getActiveSheet()->getStyle("G".$rownum.":H".$rownum)->applyFromArray($styleArray);
unset($styleArray);
Upvotes: 6
Views: 10793
Reputation: 182
While I agree that your method works @Dagon I feel it's a little messy, instead I would recommend using the 'outline' method. Like so
'borders' => array(
'outline' => array(
'style' => PHPExcel_Style_Border::BORDER_DOUBLE
),
)
Upvotes: 10
Reputation:
specify each side separately for the cells
'borders' => array(
'left' => array(
'style' => PHPExcel_Style_Border::BORDER_DOUBLE,
),
'right' => array(
'style' => PHPExcel_Style_Border::BORDER_DOUBLE,
),
'bottom' => array(
'style' => PHPExcel_Style_Border::BORDER_DOUBLE,
),
'top' => array(
'style' => PHPExcel_Style_Border::BORDER_DOUBLE,
),
one cell will have right 'none' one with have left 'none'
Upvotes: 2