Click or drag to resize
ConditionalStyleType Enumeration
Represents possible table areas to which conditional formatting may be defined in a table style.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.9
Syntax
public enum ConditionalStyleType
Members
  Member nameValueDescription
FirstRow0 Specifies formatting of the first row of a table.
FirstColumn1 Specifies formatting of the first column of a table.
LastRow2 Specifies formatting of the last row of a table.
LastColumn3 Specifies formatting of the last column of a table.
OddRowBanding4 Specifies formatting of odd-numbered row stripe.
OddColumnBanding5 Specifies formatting of odd-numbered column stripe.
EvenRowBanding6 Specifies formatting of even-numbered row stripe.
EvenColumnBanding7 Specifies formatting of even-numbered column stripe.
TopLeftCell8 Specifies formatting of the top left cell of a table.
TopRightCell9 Specifies formatting of the top right cell of a table.
BottomLeftCell10 Specifies formatting of the bottom left cell of a table.
BottomRightCell11 Specifies formatting of the bottom right cell of a table.
Examples
Shows how to work with certain area styles of a table.
[C#]

Document doc = new Document(MyDir + "Table.ConditionalStyles.docx");

TableStyle tableStyle = (TableStyle)doc.Styles.Add(StyleType.Table, "MyTableStyle1");
// There is a different ways how to get conditional styles:
// by conditional style type
tableStyle.ConditionalStyles[ConditionalStyleType.FirstRow].Shading.BackgroundPatternColor = Color.AliceBlue;
// by index
tableStyle.ConditionalStyles[0].Borders.Color = Color.Black;
tableStyle.ConditionalStyles[0].Borders.LineStyle = LineStyle.DotDash;
Assert.AreEqual(ConditionalStyleType.FirstRow, tableStyle.ConditionalStyles[0].Type);
// directly from ConditionalStyleCollection
tableStyle.ConditionalStyles.FirstRow.ParagraphFormat.Alignment = ParagraphAlignment.Center;
// To see this in Word document select Total Row checkbox in Design Tab
tableStyle.ConditionalStyles.LastRow.BottomPadding = 10;
tableStyle.ConditionalStyles.LastRow.LeftPadding = 10;
tableStyle.ConditionalStyles.LastRow.RightPadding = 10;
tableStyle.ConditionalStyles.LastRow.TopPadding = 10;
// To see this in Word document select Last Column checkbox in Design Tab
tableStyle.ConditionalStyles.LastColumn.Font.Bold = true;

Console.WriteLine(tableStyle.ConditionalStyles.Count);
Console.WriteLine(tableStyle.ConditionalStyles[0].Type);

Table table = (Table) doc.GetChild(NodeType.Table, 0, true);
table.Style = tableStyle;

doc.Save(ArtifactsDir + "Table.WorkWithTableConditionalStyles.docx");
See Also