How to set cell filling in PHPExcel?

Does anyone know how to set cell filling in PHPExcel? I searched for 30 minutes and still can not find the right solution. There is no useful documentation for this.

+7
source share
3 answers

maybe

$objPHPExcel->getActiveSheet()->getStyle('A1')->getAlignment()->setIndent(1); 
+14
source

Cell Padding is an HTML concept and there is nothing like it in Excel. How would you set cell filling in MS Excel itself?

Probably the best thing you can do is adjust the height and width of the cell.

EDIT

I searched for this, and even Microsoft said that in Excel there is no equivalent to filling cells. It seems that the best option is to use cell alignment indents (combined with column width) for horizontal padding; height and vertical vertical alignment. They can be installed in PHPExcel.

+1
source

Just add, note that this will only work if horizontal alignment is set left or right.

Must precede this (if it has not already been executed)

 $objPHPExcel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); 

Greetings

+1
source

All Articles