开发者

How to set auto height in phpexcel?

I am using phpexcel to开发者_如何学Go generate excel document with PHP.

the question is, how to make auto height row using phpexcel? many thanks :)


$excel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);

Should set the row height to 'auto' for row 1.


$excel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(-1);


To change height of all rows to auto you can do:

foreach($xls->getActiveSheet()->getRowDimensions() as $rd) { 
    $rd->setRowHeight(-1); 
}


You can set it by using following code,

$objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);
$objPHPExcel->getActiveSheet()->getStyle('E')->getAlignment()->setWrapText(true);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜