I’m Trying to recreate the table (example in the attachment) with the documentbuilder
Hi Kevin,
Thanks
for your inquiry. Unfortunately, Aspose.Words does not support to set/get positioning of floating table at the moment. However, I have logged this feature
request as WORDSNET-12204 in our issue tracking system. You will be
notified via this forum thread once this feature is available.
We apologize for your inconvenience.
The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan
The issues you have found earlier (filed as WORDSNET-12204) have been fixed in this Aspose.Words for .NET 20.1 update and this Aspose.Words for Java 20.1 update.
It is to inform you that starting from Aspose.Words 20.1 it is possible to float the table next to text. We added RelativeHorizontalAlignment, AbsoluteHorizontalDistance, RelativeVerticalAlignment, and AbsoluteVerticalDistance properties in table class. You can use these properties to set the table’s position on the page in Word document according to your requirement.
Following code example 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");