The content of this article is to share with you the solution to the problem of incomplete borders or only vertical lines after setting the border in phpexcel. Friends in need can refer to it
When exporting files with phpexcel, set the Borders, but always only vertical lines.
There is no way to set all the borders using the method given in the manual
$objPHPExcel->getActiveSheet()->getStyle('A2:D2')->getBorders()->getAllBorders()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
After setting, there is only the vertical line on the left.
Use another method provided by others online to set the border normally.
$style_array = array( 'borders' => array( 'allborders' => array( 'style' => \PHPExcel_Style_Border::BORDER_THIN ) ) ); $sheet->getStyle('A1:L'.($start_row-1))->applyFromArray($style_array);
The above is the detailed content of How to solve the problem of incomplete or only vertical lines when setting borders in phpexcel. For more information, please follow other related articles on the PHP Chinese website!