text_wrapping property
Table.text_wrapping property
Gets or sets Table.text_wrapping for table.
@property
def text_wrapping(self) -> aspose.words.tables.TextWrapping:
...
@text_wrapping.setter
def text_wrapping(self, value: aspose.words.tables.TextWrapping):
...
Examples
Shows how to work with table text wrapping.
doc = aw.Document()
builder = aw.DocumentBuilder(doc=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 "TextWrapping" 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(file_name=ARTIFACTS_DIR + 'Table.WrapText.docx')
See Also
- module aspose.words.tables
- class Table