Set table position based on number of columns in table

Hi,


I want to set table position based on data and no. of column in table on slide. I have attached a pptx file, will give better understanding of issue please help to resolve it.

Attached herewith pptx file, contains 3 slides.
1st slide - Chart with 6 no. of columns so its position should be left showed in slide.
2nd slide - Chart with 3 no. of columns so its position should be center of slide showed in slide.
3rd slide - Chart with 2 no. of columns so its position should be center of slide showed in slide.

Thanks.

Hi Jonathan,

I have observed the requirements shared by you and like to share that Aspose.Slides allows setting X and Y position for ITable inside presentation. You can set the position based on your requirements on your end. As a suggestion in order to meet your requirement you may try using the following approach for setting X position of table inside slide.

Presentation pres=new Presentation(“Test.pptx”);
ISlide slide=pres.Slides[0];
ITable table=(ITable)slide.Shapes[0];

table.X=(pres.SlideSize.Size.Width - table.Width)/2;

I hope the shared sample code will be helpful. Please share, if I may help you further in this regard.

Many Thanks,