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

Charles
  • 50,943
  • 13
  • 104
  • 142
Uffo
  • 9,628
  • 24
  • 90
  • 154

2 Answers2

7

Bold:

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

Width:

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

Not tested though.

dfilkovi
  • 3,051
  • 7
  • 39
  • 51
0

$col zero 0 based

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

Hi 2009

john Griffiths
  • 247
  • 1
  • 2
  • 5