Cell range style with phpexcel

I am trying to create an excel table with phpexcel. I'm doing it:

$sheet->getStyle('A1:B2')->applyFromArray($style); 

But it would be better if I could give the numerical coordinates. I can use getStyleByColumnAndRow($x, $y) with one cell, but not with a range. Any ideas? Is it supported?

Thanks in advance, M.

+8
php phpexcel
source share
1 answer

You can generate cell names A1 and B2 from integer coordinates using the PHPExcel function, the name of which I do not currently remember (will be added when it is detected) and simply concatenate the names using ":" as the glue symbol and use the same code as and now.

EDIT

The function used to create the column name by its coordinate,

 PHPExcel_Cell::stringFromColumnIndex($colIndex) 
+10
source share

All Articles