跳到主要内容

SetShd

Specifies the shading which is applied to the extents of the current table.

Syntax

expression.SetShd(sType, r, g, b, isAuto);

expression - A variable that represents a ApiTable class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sTypeRequiredShdTypeThe shading type applied to the extents of the current table.
rRequiredbyteRed color component value.
gRequiredbyteGreen color component value.
bRequiredbyteBlue color component value.
isAutoOptionalbooleanfalseThe true value disables the SetShd method use.

Returns

boolean

Example

This example specifies the shading which shall be applied to the extents of the table.

// How to add shading to the paragraph.

// Apply the clear shading to the paragraph.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
paragraph.AddText("We added an orange shading to the table:");
let tableStyle = doc.CreateStyle("CustomTableStyle", "table");
tableStyle.SetBasedOn(doc.GetStyle("Bordered"));
let tablePr = tableStyle.GetTablePr();
let table = Api.CreateTable(3, 3);
tablePr.SetShd("clear", 255, 111, 61, false);
table.SetTableLook(true, true, true, true, false, false);
table.SetStyle(tableStyle);
doc.Push(table);