How to change font size of text within a table created by Python-pptx

后端 未结 1 911
小蘑菇
小蘑菇 2021-01-12 22:59

I am creating a script to show graphs of product performance and creating a table to display its partnumber, a list of applications and the number of current applications.

相关标签:
1条回答
  • 2021-01-12 23:33

    A _Cell object doesn't directly contain paragraphs. However, it does include a TextFrame object on .text_frame which contains the paragraphs. So if you just use:

    cell.text_frame.paragraphs[0]
    

    ..you should get what you expect. Note that it's .paragraphs, not .paragraph.

    The API documentation for _Cell is here: http://python-pptx.readthedocs.io/en/latest/api/table.html#cell-objects

    and generally provides all the details needed to resolve the finer points like this one.

    0 讨论(0)
提交回复
热议问题