Home  >  Article  >  Backend Development  >  How to solve the problem of incomplete or only vertical lines when setting borders in phpexcel

How to solve the problem of incomplete or only vertical lines when setting borders in phpexcel

不言
不言Original
2018-04-09 11:31:122637browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn