TableAbsoluteHorizontalDistance Property

Gets or sets absolute horizontal floating table position specified by the table properties, in points. Default value is 0.

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

Syntax

public double AbsoluteHorizontalDistance { get; set; }

Property Value

Type: Double

Examples

Shows how set the location of floating tables.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a table
Table table = builder.StartTable();
builder.InsertCell();
builder.Write("Table 1, cell 1");
builder.EndTable();
table.PreferredWidth = PreferredWidth.FromPoints(300);

// We can set the table's location to a place on the page, such as the bottom right corner
table.RelativeVerticalAlignment = VerticalAlignment.Bottom;
table.RelativeHorizontalAlignment = HorizontalAlignment.Right;

table = builder.StartTable();
builder.InsertCell();
builder.Write("Table 2, cell 1");
builder.EndTable();
table.PreferredWidth = PreferredWidth.FromPoints(300);

// We can also set a horizontal and vertical offset from the location in the paragraph where the table was inserted 
table.AbsoluteVerticalDistance = 50;
table.AbsoluteHorizontalDistance = 100;

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

See Also