Writing text between merged cells using phpExcel

I have this code from phpExel.



This code creates white space between columns A1-I1. Just add some text in the white center space (A1: I1).

I am trying to use this code:

$objPHPExcel->setActiveSheetIndex(1)->mergeCells('A1:I1','add some text here...');


but this code doesn't work. Can anyone help me?


source to share

1 answer

You just write the text value you want to the top left cell in the range of merged cells

    ->setValue('This is the text that I want to see in the merged cells');



To center the text use



using the top left cell of the range



All Articles