TextWrapping enumeration

TextWrapping enumeration

Specifies how text is wrapped around the table.

Members

NameDescription
NONEText and table is displayed in the order of their appearance in the document.
AROUNDText is wrapped around the table occupying available side space.
DEFAULTDefault value.

Examples

Shows how to work with table text wrapping.

doc = aw.Document()
builder = aw.DocumentBuilder(doc)

table = builder.start_table()
builder.insert_cell()
builder.write("Cell 1")
builder.insert_cell()
builder.write("Cell 2")
builder.end_table()
table.preferred_width = aw.tables.PreferredWidth.from_points(300)

builder.font.size = 16
builder.writeln("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")

# Set the "text_wrapping" property to "TextWrapping.AROUND" to get the table to wrap text around it,
# and push it down into the paragraph below by setting the position.
table.text_wrapping = aw.tables.TextWrapping.AROUND
table.absolute_horizontal_distance = 100
table.absolute_vertical_distance = 20

doc.save(ARTIFACTS_DIR + "Table.wrap_text.docx")

See Also