Vertical alignment for all cells?

Topics: Developer Forum, Project Management Forum, User Forum
Apr 19, 2010 at 11:08 AM

Info about the excel created:

* 68 cols

* 50 rows

* Some cells have some lines and do the rows more height

* No data in all cells

If I create a excel without vertical top alignment:

* 2 seconds

* 207kb

But If I add vertical alignment for all cells with

$objPHPExcel->getActiveSheet()->getStyle($column.$row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);

the result is:

* 10 seconds

* 230kb

Is posible add one time "all cells with Vertical Top alignment to do it more faster?

Thanks and escuse my poor english.

Developer
Apr 19, 2010 at 10:15 PM

It is faster to style many cells at once.

Example:

$objPHPExcel->getActiveSheet()->getStyle('A1:G20')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);
Apr 20, 2010 at 7:41 AM
Edited Apr 20, 2010 at 7:58 AM

Tkankyou so much, run ok.

* 3 seconds

* 217kb

Regards.