Edit

Share via


PowerPoint.TableCellBorders interface

Represents the borders of a table cell.

Remarks

[ API set: PowerPointApi 1.8 ]

Examples

// 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();
});

Properties

bottom

Represents the bottom border.

diagonalDown

Represents the diagonal border (top-left to bottom-right).

diagonalUp

Represents the diagonal border (bottom-left to top-right).

left

Represents the left border.

right

Represents the right border.

top

Represents the top border.

Property Details

bottom

Represents the bottom border.

bottom?: PowerPoint.BorderProperties;

Property Value

Remarks

[ API set: PowerPointApi 1.8 ]

Examples

// 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();
});

diagonalDown

Represents the diagonal border (top-left to bottom-right).

diagonalDown?: PowerPoint.BorderProperties;

Property Value

Remarks

[ API set: PowerPointApi 1.8 ]

diagonalUp

Represents the diagonal border (bottom-left to top-right).

diagonalUp?: PowerPoint.BorderProperties;

Property Value

Remarks

[ API set: PowerPointApi 1.8 ]

left

Represents the left border.

left?: PowerPoint.BorderProperties;

Property Value

Remarks

[ API set: PowerPointApi 1.8 ]

Examples

// 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();
});

right

Represents the right border.

right?: PowerPoint.BorderProperties;

Property Value

Remarks

[ API set: PowerPointApi 1.8 ]

Examples

// 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();
});

top

Represents the top border.

top?: PowerPoint.BorderProperties;

Property Value

Remarks

[ API set: PowerPointApi 1.8 ]

Examples

// 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();
});