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

Regarding the problem of setting column width in PHPExcle.

ringa_lee
ringa_leeOriginal
2018-05-10 13:43:143267browse


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");

$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");

$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.

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
Previous article:phpsotrm cannot be openedNext article:phpsotrm cannot be opened