Support for Positioning Floating Tables

Hello,

It seems that Aspose Words provides some support for floating (or “in-line”) tables via the “Table.setTextWrapping(TextWrapping.AROUND)” API. However, based on the following posts, it seems that there are currently no APIs for the positioning properties of the floating table:

  1. https://docs.aspose.com/words/net/features/
    Which states “there is currently no API to access or modify the floating position of a table”
  2. https://forum.aspose.com/t/58911
    Note that the TextBox workaround provided here is not ideal.

Are there any plans on supporting the positioning properties of a floating table?
Thanks.

Hi there,

Thanks for your inquiry. Unfortunately, Aspose.Words does not support the requested feature at the moment. However, we have already 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 WORDSNET-12204) have been fixed in this Aspose.Words for .NET 20.1 update and this Aspose.Words for Java 20.1 update.

@oraspose
It is very easy to float the table on the page at any position in Word document using table properties (RelativeHorizontalAlignment, AbsoluteHorizontalDistance, RelativeVerticalAlignment, and AbsoluteVerticalDistance) as shown below. We added this feature in Aspose.Words 20.1.
Following code example inserts two tables in the document and set their position.

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.setPreferredWidth(PreferredWidth.fromPoints(300));

// We can set the table's location to a place on the page, such as the bottom right corner
table.setRelativeVerticalAlignment(VerticalAlignment.BOTTOM);
table.setRelativeHorizontalAlignment(HorizontalAlignment.RIGHT);

table = builder.startTable();
builder.insertCell();
builder.write("Table 2, cell 1");
builder.endTable();
table.setPreferredWidth(PreferredWidth.fromPoints(300));

// We can also set a horizontal and vertical offset from the location in the paragraph where the table was inserted
table.setAbsoluteVerticalDistance(50);
table.setAbsoluteHorizontalDistance(100);

doc.save(MyDir + "Table.ChangeFloatingTableProperties.docx");