SetShading

Table.SetShading method

تعيين التظليل إلى القيم المحددة على الجدول بأكمله.

public void SetShading(TextureIndex texture, Color foregroundColor, Color backgroundColor)
معامليكتبوصف
textureTextureIndexالملمس المراد تطبيقه.
foregroundColorColorلون الملمس.
backgroundColorColorلون تعبئة الخلفية.

أمثلة

يوضح كيفية تطبيق حدود تفصيلية على جدول.

Document doc = new Document(MyDir + "Tables.docx");
Table table = doc.FirstSection.Body.Tables[0];

//محاذاة الجدول إلى منتصف الصفحة.
table.Alignment = TableAlignment.Center;

// قم بمسح أي حدود وتظليل موجود من الجدول.
table.ClearBorders();
table.ClearShading();

//أضف حدودًا خضراء إلى مخطط الجدول.
table.SetBorder(BorderType.Left, LineStyle.Single, 1.5, Color.Green, true);
table.SetBorder(BorderType.Right, LineStyle.Single, 1.5, Color.Green, true);
table.SetBorder(BorderType.Top, LineStyle.Single, 1.5, Color.Green, true);
table.SetBorder(BorderType.Bottom, LineStyle.Single, 1.5, Color.Green, true);

// املأ الخلايا بلون أخضر فاتح.
table.SetShading(TextureIndex.TextureSolid, Color.LightGreen, Color.Empty);

doc.Save(ArtifactsDir + "Table.SetOutlineBorders.docx");

أنظر أيضا