PowerPoint.BorderProperties interface
表示表格单元格边框的属性。
注解
示例
// 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();
});
属性
color | 表示十六进制格式 #RRGGBB (行颜色,例如“FFA500”) 或命名的 HTML 颜色值 (例如“orange”) 。 |
dash |
表示线条的短划线样式。 |
transparency | 将行的透明度百分比指定为从 0.0 (不透明) 到 1.0 (清除) 的值。 |
weight | 表示线条的粗细(以磅为单位)。 |
属性详细信息
color
表示十六进制格式 #RRGGBB (行颜色,例如“FFA500”) 或命名的 HTML 颜色值 (例如“orange”) 。
color?: string | undefined;
属性值
string | undefined
注解
示例
// 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();
});
dashStyle
表示线条的短划线样式。
dashStyle?: PowerPoint.ShapeLineDashStyle | "Dash" | "DashDot" | "DashDotDot" | "LongDash" | "LongDashDot" | "RoundDot" | "Solid" | "SquareDot" | "LongDashDotDot" | "SystemDash" | "SystemDot" | "SystemDashDot" | undefined;
属性值
PowerPoint.ShapeLineDashStyle | "Dash" | "DashDot" | "DashDotDot" | "LongDash" | "LongDashDot" | "RoundDot" | "Solid" | "SquareDot" | "LongDashDotDot" | "SystemDash" | "SystemDot" | "SystemDashDot" | undefined
注解
示例
// 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();
});
transparency
将行的透明度百分比指定为从 0.0 (不透明) 到 1.0 (清除) 的值。
transparency?: number | undefined;
属性值
number | undefined
注解
weight
表示线条的粗细(以磅为单位)。
weight?: number | undefined;
属性值
number | undefined
注解
示例
// 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();
});