setting cell margins

Topics: Developer Forum, User Forum
Mar 27, 2009 at 9:32 AM
Hello.

Is there any examples on how to set cell's margins?

Developer
Mar 30, 2009 at 6:12 AM
Do you have a sample workbook what you are trying to accomplish? As far as I know there is no concept like cell margin's in Excel?

Mar 30, 2009 at 9:06 AM
Edited Mar 30, 2009 at 9:09 AM
you are right. there is no cell margin's in Excel.
i mean something like css property "padding".
as you see, it's like css property: padding-right: 1;
i'm sorry, but there is no english version of MSOffice close to me.



Developer
Mar 30, 2009 at 2:56 PM
If I understand the screen shot correctly you are looking for indentation.

Example:

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

Can also be used in combination with horizontal alignment to get indentation from the right:

$objPHPExcel->getActiveSheet()->getStyle('A1')->getAlignment()->setIndent(1);
$objPHPExcel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);


Mar 30, 2009 at 3:03 PM
setIndent(); is exactly what I needed. It works. Thanks :)