0

I want to create a table of a specific row and column number and size and align it to the centre of the slide.

Is there any way to do this?

I found a way to align image: python pptx align image to center of slide

but cannot find anything about aligning tables.

MueezK
  • 25
  • 3

2 Answers2

2

You would just centre in the same way you would any other shape.

Once created.

shape.left = int((presentation.slide_width / 2) - (shape.width / 2))
shape.top = int((presentation.slide_height / 2) - (shape.height / 2))
Luke Bowes
  • 292
  • 2
  • 7
0

The Presentation object has slide_width and slide_height. The Shapes object has (settable) left, width,top,height.

Between these you should be able to position (and size) a shape anywhere you like on the slide. Centring is a matter of geometry.

Martin Packer
  • 648
  • 4
  • 12