Home > Backend Development > PHP Tutorial > Regarding the problem of setting column width in PHPExcle.

Regarding the problem of setting column width in PHPExcle.

ringa_lee
Release: 2023-03-01 08:48:01
Original
3284 people have browsed it


The code is as follows:
$objPHPExcel->getProperties()->setCreator("Maarten Balliauw")

        ->setLastModifiedBy("Maarten Balliauw")
        ->setTitle("Office 2007 XLSX Test Document")
        ->setSubject("Office 2007 XLSX Test Document")
        ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
        ->setKeywords("office 2007 openxml php")
        ->setCategory("Test result file");
Copy after login

$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth (30);
Setting the width like this is completely invalid. What’s the reason? Looking forward to the answer, thank you.

Reply content:

The code is as follows:
$objPHPExcel->getProperties()->setCreator("Maarten Balliauw")

        ->setLastModifiedBy("Maarten Balliauw")
        ->setTitle("Office 2007 XLSX Test Document")
        ->setSubject("Office 2007 XLSX Test Document")
        ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
        ->setKeywords("office 2007 openxml php")
        ->setCategory("Test result file");
Copy after login

$objPHPExcel->getActiveSheet()->getColumnDimension('A')- >setWidth(30);
Setting the width like this is completely invalid. What is the reason? Looking forward to the answer, thank you.

Related labels:
php
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