Uffo
Uffo

Reputation: 10046

PHPExcel style problem

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

Upvotes: 3

Views: 3442

Answers (2)

john Griffiths
john Griffiths

Reputation: 247

$col zero 0 based

$worksheet->getColumnDimensionByColumn($col)->setWidth($width);

Hi 2009

Upvotes: 0

dfilkovi
dfilkovi

Reputation: 3081

Bold:

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

Width:

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

Not tested though.

Upvotes: 7

Related Questions