TableAlignment Enumeration

Specifies alignment for an inline table.

Namespace:  Aspose.Words.Tables
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.7.0


public enum TableAlignment


  Member nameValueDescription
Left0 The table is aligned to the left.
Center1 The table is centered.
Right2 The table is aligned to the right.


Shows how to apply a outline border to a table.
Document doc = new Document(MyDir + "Tables.docx");
Table table = (Table)doc.GetChild(NodeType.Table, 0, true);

// Align the table to the center of the page
table.Alignment = TableAlignment.Center;

// Clear any existing borders and shading from the table

// Set a green border around the table but not inside
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);

// Fill the cells with a light green solid color
table.SetShading(TextureIndex.TextureSolid, Color.LightGreen, Color.Empty);

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

See Also