PHPExcel Style Problem

$objPHPExcel->getActiveSheet()->SetCellValue('A1', 'Name');

1.How did I make it bold?

2.How to set the width (I will have some dynamic text in the cells!)?

I read the documentation, but I did not find any solutions!

+3
source share
2 answers

Fatty

$objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);

width:

$objPHPExcel->getActiveSheet()->getCell('A1')->setWidth(15);

Not tested.

+7
source

$ col 0 based

$ worksheet-> getColumnDimensionByColumn ($ COL) → setWidth ($ width);

Hello 2009

0
source

Source: https://habr.com/ru/post/1724916/


All Articles