PowerPoint.TableMergedAreaProperties 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 merge areas of a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying one 2x2 merged area.
  shapes.addTable(3, 4, {
    values: [
      ["A", "BB", "CCC", "DDDD"],
      ["E", "FF", "", "HHHH"],
      ["1", "", "", "1234"]
    ],
    mergedAreas: [{ rowIndex: 1, columnIndex: 1, rowCount: 2, columnCount: 2 }]
  });
  await context.sync();
});

属性

columnCount

指定合并单元格区域的列数。 必须为 1 或更大。

columnIndex

指定合并区域的左上单元格列的从零开始的索引。

rowCount

指定合并单元格区域的行数。 必须为 1 或更大。

rowIndex

指定合并区域的左上单元格行的从零开始的索引。

属性详细信息

columnCount

指定合并单元格区域的列数。 必须为 1 或更大。

columnCount: number;

属性值

number

注解

[ 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 merge areas of a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying one 2x2 merged area.
  shapes.addTable(3, 4, {
    values: [
      ["A", "BB", "CCC", "DDDD"],
      ["E", "FF", "", "HHHH"],
      ["1", "", "", "1234"]
    ],
    mergedAreas: [{ rowIndex: 1, columnIndex: 1, rowCount: 2, columnCount: 2 }]
  });
  await context.sync();
});

columnIndex

指定合并区域的左上单元格列的从零开始的索引。

columnIndex: number;

属性值

number

注解

[ 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 merge areas of a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying one 2x2 merged area.
  shapes.addTable(3, 4, {
    values: [
      ["A", "BB", "CCC", "DDDD"],
      ["E", "FF", "", "HHHH"],
      ["1", "", "", "1234"]
    ],
    mergedAreas: [{ rowIndex: 1, columnIndex: 1, rowCount: 2, columnCount: 2 }]
  });
  await context.sync();
});

rowCount

指定合并单元格区域的行数。 必须为 1 或更大。

rowCount: number;

属性值

number

注解

[ 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 merge areas of a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying one 2x2 merged area.
  shapes.addTable(3, 4, {
    values: [
      ["A", "BB", "CCC", "DDDD"],
      ["E", "FF", "", "HHHH"],
      ["1", "", "", "1234"]
    ],
    mergedAreas: [{ rowIndex: 1, columnIndex: 1, rowCount: 2, columnCount: 2 }]
  });
  await context.sync();
});

rowIndex

指定合并区域的左上单元格行的从零开始的索引。

rowIndex: number;

属性值

number

注解

[ 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 merge areas of a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying one 2x2 merged area.
  shapes.addTable(3, 4, {
    values: [
      ["A", "BB", "CCC", "DDDD"],
      ["E", "FF", "", "HHHH"],
      ["1", "", "", "1234"]
    ],
    mergedAreas: [{ rowIndex: 1, columnIndex: 1, rowCount: 2, columnCount: 2 }]
  });
  await context.sync();
});