Freigeben über


PowerPoint.TableCellProperties interface

Stellt die zu aktualisierenden Tabellenzelleneigenschaften dar.

Hinweise

[ API-Satz: PowerPointApi 1.8 ]

Beispiele

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

// Specifies the font formatting and fill colors of the cells in a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying font formatting and fill colors.
  shapes.addTable(3, 4, {
    values: [
      ["A", "BB", "CCC", "DDDD"],
      ["E", "FF", "GGG", "HHHH"],
      ["1", "12", "123", "1234"]
    ],
    specificCellProperties: [
      [
        { fill: { color: "red" }, font: { color: "yellow", name: "Calibri" } },
        { fill: { color: "#0048ba" }, font: { color: "yellow", name: "Coolvetica" } },
        { fill: { color: "red" }, font: { color: "yellow", italic: true } },
        { fill: { color: "red" }, font: { color: "#9966cc", strikethrough: true } }
      ],
      [
        { fill: { color: "#fbceb1" }, font: { color: "yellow", doubleStrikethrough: true } },
        { fill: { color: "red" }, font: { color: "yellow", subscript: true } },
        { fill: { color: "#0048ba" }, font: { color: "yellow", superscript: true } },
        { fill: { color: "red" }, font: { color: "yellow" } }
      ],
      [
        { fill: { color: "red" }, font: { color: "#b0bf1a" } },
        { fill: { color: "#9966cc" }, font: { color: "yellow" } },
        { fill: { color: "#b0bf1a" }, font: { color: "yellow" } },
        { fill: { color: "red" }, font: { color: "#fbceb1" } }
      ]
    ]
  });
  await context.sync();
});

Eigenschaften

borders

Gibt die Rahmenformatierung der Tabellenzelle an.

fill

Gibt die Füllformatierung der Tabellenzelle an.

font

Gibt die Schriftartformatierung der Tabellenzelle an.

horizontalAlignment

Gibt die horizontale Ausrichtung des Texts in der Tabellenzelle an.

indentLevel

Gibt die Einzugsebene des Texts in der Tabellenzelle an.

margins

Gibt die Randeinstellungen in der Tabellenzelle an.

text

Gibt den Textinhalt der Tabellenzelle an.

Wenn ein Teil des Texts eine andere Formatierung erfordert, verwenden Sie stattdessen die textRuns -Eigenschaft.

textRuns

Gibt den Inhalt der Tabellenzelle als Array von PowerPoint.TextRun-Objekten an. Jedes TextRun -Objekt stellt eine Sequenz von einem oder mehreren Zeichen dar, die die gleichen Schriftartattribute verwenden.

verticalAlignment

Gibt die vertikale Ausrichtung des Texts in der Tabellenzelle an.

Details zur Eigenschaft

borders

Gibt die Rahmenformatierung der Tabellenzelle an.

borders?: PowerPoint.TableCellBorders;

Eigenschaftswert

Hinweise

[ API-Satz: PowerPointApi 1.8 ]

Beispiele

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

// Specifies a table's borders.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying border styles.
  shapes.addTable(3, 4, {
    values: [
      ["A", "BB", "CCC", "DDDD"],
      ["E", "FF", "GGG", "HHHH"],
      ["1", "12", "123", "1234"]
    ],
    uniformCellProperties: {
      borders: {
        left: { color: "blue", dashStyle: PowerPoint.ShapeLineDashStyle.solid, weight: 4 },
        right: { color: "blue", dashStyle: PowerPoint.ShapeLineDashStyle.solid, weight: 4 },
        top: { color: "red", dashStyle: PowerPoint.ShapeLineDashStyle.longDashDotDot, weight: 2 },
        bottom: { color: "red", dashStyle: PowerPoint.ShapeLineDashStyle.longDashDotDot, weight: 2 }
      }
    }
  });
  await context.sync();
});

fill

Gibt die Füllformatierung der Tabellenzelle an.

fill?: PowerPoint.FillProperties;

Eigenschaftswert

Hinweise

[ API-Satz: PowerPointApi 1.8 ]

Beispiele

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

// Specifies the font formatting and fill colors of the cells in a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying font formatting and fill colors.
  shapes.addTable(3, 4, {
    values: [
      ["A", "BB", "CCC", "DDDD"],
      ["E", "FF", "GGG", "HHHH"],
      ["1", "12", "123", "1234"]
    ],
    specificCellProperties: [
      [
        { fill: { color: "red" }, font: { color: "yellow", name: "Calibri" } },
        { fill: { color: "#0048ba" }, font: { color: "yellow", name: "Coolvetica" } },
        { fill: { color: "red" }, font: { color: "yellow", italic: true } },
        { fill: { color: "red" }, font: { color: "#9966cc", strikethrough: true } }
      ],
      [
        { fill: { color: "#fbceb1" }, font: { color: "yellow", doubleStrikethrough: true } },
        { fill: { color: "red" }, font: { color: "yellow", subscript: true } },
        { fill: { color: "#0048ba" }, font: { color: "yellow", superscript: true } },
        { fill: { color: "red" }, font: { color: "yellow" } }
      ],
      [
        { fill: { color: "red" }, font: { color: "#b0bf1a" } },
        { fill: { color: "#9966cc" }, font: { color: "yellow" } },
        { fill: { color: "#b0bf1a" }, font: { color: "yellow" } },
        { fill: { color: "red" }, font: { color: "#fbceb1" } }
      ]
    ]
  });
  await context.sync();
});

font

Gibt die Schriftartformatierung der Tabellenzelle an.

font?: PowerPoint.FontProperties;

Eigenschaftswert

Hinweise

[ API-Satz: PowerPointApi 1.8 ]

Beispiele

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

// Specifies the font formatting and fill colors of the cells in a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying font formatting and fill colors.
  shapes.addTable(3, 4, {
    values: [
      ["A", "BB", "CCC", "DDDD"],
      ["E", "FF", "GGG", "HHHH"],
      ["1", "12", "123", "1234"]
    ],
    specificCellProperties: [
      [
        { fill: { color: "red" }, font: { color: "yellow", name: "Calibri" } },
        { fill: { color: "#0048ba" }, font: { color: "yellow", name: "Coolvetica" } },
        { fill: { color: "red" }, font: { color: "yellow", italic: true } },
        { fill: { color: "red" }, font: { color: "#9966cc", strikethrough: true } }
      ],
      [
        { fill: { color: "#fbceb1" }, font: { color: "yellow", doubleStrikethrough: true } },
        { fill: { color: "red" }, font: { color: "yellow", subscript: true } },
        { fill: { color: "#0048ba" }, font: { color: "yellow", superscript: true } },
        { fill: { color: "red" }, font: { color: "yellow" } }
      ],
      [
        { fill: { color: "red" }, font: { color: "#b0bf1a" } },
        { fill: { color: "#9966cc" }, font: { color: "yellow" } },
        { fill: { color: "#b0bf1a" }, font: { color: "yellow" } },
        { fill: { color: "red" }, font: { color: "#fbceb1" } }
      ]
    ]
  });
  await context.sync();
});

horizontalAlignment

Gibt die horizontale Ausrichtung des Texts in der Tabellenzelle an.

horizontalAlignment?: PowerPoint.ParagraphHorizontalAlignment | "Left" | "Center" | "Right" | "Justify" | "JustifyLow" | "Distributed" | "ThaiDistributed" | undefined;

Eigenschaftswert

PowerPoint.ParagraphHorizontalAlignment | "Left" | "Center" | "Right" | "Justify" | "JustifyLow" | "Distributed" | "ThaiDistributed" | undefined

Hinweise

[ API-Satz: PowerPointApi 1.8 ]

Beispiele

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

// Specifies the horizontal and vertical alignments of the cells in a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying horizontal and vertical alignment.
  shapes.addTable(3, 4, {
    values: [
      ["A", "BB", "CCC", "DDDD"],
      ["E", "FF", "GGG", "HHHH"],
      ["1", "12", "123", "1234"]
    ],
    uniformCellProperties: {
      horizontalAlignment: PowerPoint.ParagraphHorizontalAlignment.justify,
      verticalAlignment: PowerPoint.TextVerticalAlignment.middle
    }
  });
  await context.sync();
});

indentLevel

Gibt die Einzugsebene des Texts in der Tabellenzelle an.

indentLevel?: number | undefined;

Eigenschaftswert

number | undefined

Hinweise

[ API-Satz: PowerPointApi 1.8 ]

Beispiele

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

// Specifying the indents for a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying the indent level for cells.
  shapes.addTable(3, 4, {
    values: [
      ["A", "BB", "CCC", "DDDD"],
      ["E", "FF", "GGG", "HHHH"],
      ["1", "12", "123", "1234"]
    ],
    specificCellProperties: [
      [{ indentLevel: 0 }, { indentLevel: 1 }, { indentLevel: 2 }, { indentLevel: 3 }],
      [{ indentLevel: 0 }, { indentLevel: 1 }, { indentLevel: 2 }, { indentLevel: 3 }],
      [{ indentLevel: 0 }, { indentLevel: 1 }, { indentLevel: 2 }, { indentLevel: 3 }]
    ]
  });
  await context.sync();
});

margins

Gibt die Randeinstellungen in der Tabellenzelle an.

margins?: PowerPoint.TableCellMargins;

Eigenschaftswert

Hinweise

[ API-Satz: PowerPointApi 1.8 ]

text

Gibt den Textinhalt der Tabellenzelle an.

Wenn ein Teil des Texts eine andere Formatierung erfordert, verwenden Sie stattdessen die textRuns -Eigenschaft.

text?: string;

Eigenschaftswert

string

Hinweise

[ API-Satz: PowerPointApi 1.8 ]

textRuns

Gibt den Inhalt der Tabellenzelle als Array von PowerPoint.TextRun-Objekten an. Jedes TextRun -Objekt stellt eine Sequenz von einem oder mehreren Zeichen dar, die die gleichen Schriftartattribute verwenden.

textRuns?: PowerPoint.TextRun[];

Eigenschaftswert

Hinweise

[ API-Satz: PowerPointApi 1.8 ]

Beispiele

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

// Specifies the text runs of the cells in a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying text runs.
  shapes.addTable(3, 4, {
    specificCellProperties: [
      [
        { text: "Title text", font: { bold: true } },
        { text: "Title text", font: { bold: true } },
        { text: "Title text", font: { bold: true } },
        { text: "Title text", font: { bold: true } }
      ],
      [
        { text: "Bold text", font: { bold: true } },
        {
          textRuns: [
            { text: "Text runs with " },
            { text: "Underlined text", font: { underline: PowerPoint.ShapeFontUnderlineStyle.double } },
            { text: " and plain text" }
          ]
        },
        { text: "Italicized text", font: { italic: true } },
        { text: "Plain text" }
      ],
      [
        { text: "Bold text", font: { bold: true } },
        { text: "Underlined text", font: { underline: PowerPoint.ShapeFontUnderlineStyle.dotted } },
        {
          font: { bold: true },
          textRuns: [
            { text: "Text runs with " },
            { text: "italicized text", font: { italic: true } },
            { text: " and (inherited) bold text" }
          ]
        },
        { text: "Italicized text", font: { italic: true } }
      ]
    ]
  });
  await context.sync();
});

verticalAlignment

Gibt die vertikale Ausrichtung des Texts in der Tabellenzelle an.

verticalAlignment?: PowerPoint.TextVerticalAlignment | "Top" | "Middle" | "Bottom" | "TopCentered" | "MiddleCentered" | "BottomCentered" | undefined;

Eigenschaftswert

PowerPoint.TextVerticalAlignment | "Top" | "Middle" | "Bottom" | "TopCentered" | "MiddleCentered" | "BottomCentered" | undefined

Hinweise

[ API-Satz: PowerPointApi 1.8 ]

Beispiele

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

// Specifies the horizontal and vertical alignments of the cells in a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying horizontal and vertical alignment.
  shapes.addTable(3, 4, {
    values: [
      ["A", "BB", "CCC", "DDDD"],
      ["E", "FF", "GGG", "HHHH"],
      ["1", "12", "123", "1234"]
    ],
    uniformCellProperties: {
      horizontalAlignment: PowerPoint.ParagraphHorizontalAlignment.justify,
      verticalAlignment: PowerPoint.TextVerticalAlignment.middle
    }
  });
  await context.sync();
});