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

不言
Release: 2023-03-23 11:26:01
Original
2644 people have browsed it

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);
Copy after login

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);
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template