开发者

PHPExcel style problem

开发者 https://www.devze.com 2022-12-13 20:51 出处:网络
$objPHPExcel->getActiveSheet()->SetCellValue(\'A1\', \'Name\'); 1.How I set this to bold? 2.How I开发者_StackOverflow中文版 set the width(I will have some dinamic text in the cells!)?
$objPHPExcel->getActiveSheet()->SetCellValue('A1', 'Name');

1.How I set this to bold?

2.How I开发者_StackOverflow中文版 set the width(I will have some dinamic text in the cells!)?

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


Bold:

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

Width:

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

Not tested though.


$col zero 0 based

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

Hi 2009

0

精彩评论

暂无评论...
验证码 换一张
取 消