【问题标题】:pptx python set row height in a tablepptx python在表格中设置行高
【发布时间】:2021-07-12 14:55:43
【问题描述】:

enter image description here

left = Inches(0.2)
top = Inches(1.0)
width = Inches(15.0)
height = Inches(3)
column_width= [Inches(0.2),Inches(0.4),Inches(2),Inches(0.43),Inches(0.43)]

我想创建一个表格,它的第一行(标题)的高度只有英寸(1.0),其他行的高度是英寸(3)。我只能设置所有行的行高,但不能自定义。

有可能做这样的事情吗?

【问题讨论】:

    标签: python powerpoint python-pptx


    【解决方案1】:

    每一行都有一个可写的.height 属性。虽然您无法在 .add_table() 调用中进行设置,但您可以在之后立即或任何方便的时间进行设置。

    row = table.rows[i]
    row.height = Inches(3)
    

    【讨论】:

      猜你喜欢
      • 2011-11-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多