Cell set margin not working

Hello,

I am trying to set the margin right of a cell, but the code that I am trying is not taking effect. I still have 0.25 as margin.

final Cell cell = (Cell) table.get_Item(cellIndex, rowIndex);
cell.getTextFrame().getTextFrameFormat().setMarginLeft(1f);
cell.getTextFrame().getTextFrameFormat().setMarginRight(1f);

Thanks for your help

@Abder,

I have observed your comments. Can you please share working sample project along with environment details and sample presentation to reproduce issue so that we may further investigate to help you out.

@Adnan.Ahmad

It’s a big project, and i can’t share everything. Basically I create an array dynamically using this code:

Table table = (Table) slide.getShapes().addTable(X_Value, Y_Value, columnsWidth, rowsHeight);

Then I try to modify the value of margin by doing :

while (cellIndex < cells().size())
{
final Cell cell = (Cell) table.get_Item(cellIndex, rowIndex);
cell.getTextFrame().getTextFrameFormat().setMarginLeft(1f);
cell.getTextFrame().getTextFrameFormat().setMarginRight(1f);
cellIndex+=1;
}

I hope that’s enough to understand my problem.
Thanks

@Abder,

I have worked over your query using Aspose.Slides for Java 17.9 and unable to observe any issue. I have also shared my code snippet with you for your kind reference. I have also shared my generated result with you. Please check attachment. Can you please share which Aspose.Slides version you are using on your end. Also please share environment details with us so that we may further investigate to help you out.code.zip (468 Bytes)
ptpout13.zip (25.1 KB)

1 Like

Hello @Adnan.Ahmad

It works now for me.
Thank you for your help

@Abder,

Its good know that things are started working on your end. Please feel free to contact us any time. We will be happy to help you out.

1 Like