PowerPoint.TableColumnProperties interface

提供表列属性。

注解

[ API 集:PowerPointApi 1.8 ]

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/add-modify-tables.yaml

// Specifies the column widths and row heights of a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying column widths and row heights
  shapes.addTable(3, 4, {
    columns: [{ columnWidth: 100 }, { columnWidth: 200 }, { columnWidth: 100 }, { columnWidth: 200 }],
    rows: [{ rowHeight: 60 }, { rowHeight: 120 }, { rowHeight: 180 }]
  });
  await context.sync();
});

属性

columnWidth

表示每列的所需宽度(以磅为单位),或未定义。

添加表时,对于宽度未定义的列,将通过将表的剩余宽度均匀除以这些列来计算列宽。 如果表没有定义的宽度,将使用默认列宽。

属性详细信息

columnWidth

表示每列的所需宽度(以磅为单位),或未定义。

添加表时,对于宽度未定义的列,将通过将表的剩余宽度均匀除以这些列来计算列宽。 如果表没有定义的宽度,将使用默认列宽。

columnWidth?: number | undefined;

属性值

number | undefined

注解

[ API 集:PowerPointApi 1.8 ]

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/add-modify-tables.yaml

// Specifies the column widths and row heights of a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying column widths and row heights
  shapes.addTable(3, 4, {
    columns: [{ columnWidth: 100 }, { columnWidth: 200 }, { columnWidth: 100 }, { columnWidth: 200 }],
    rows: [{ rowHeight: 60 }, { rowHeight: 120 }, { rowHeight: 180 }]
  });
  await context.sync();
});