Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPExcel style problem

Tags:

php

phpexcel

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

1.How I set this to bold?

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

I have read the documentation, but I haven't found any solutions!

like image 896
Uffo Avatar asked Mar 14 '26 19:03

Uffo


1 Answers

Bold:

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

Width:

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

Not tested though.

like image 137
dfilkovi Avatar answered Mar 17 '26 07:03

dfilkovi