top_padding property
Table.top_padding property
Gets or sets the amount of space (in points) to add above the contents of cells.
@property
def top_padding(self) -> float:
...
@top_padding.setter
def top_padding(self, value: float):
...
Examples
Shows how to configure content padding in a table.
doc = aw.Document()
builder = aw.DocumentBuilder(doc=doc)
table = builder.start_table()
builder.insert_cell()
builder.write('Row 1, cell 1.')
builder.insert_cell()
builder.write('Row 1, cell 2.')
builder.end_table()
# For every cell in the table, set the distance between its contents and each of its borders.
# This table will maintain the minimum padding distance by wrapping text.
table.left_padding = 30
table.right_padding = 60
table.top_padding = 10
table.bottom_padding = 90
table.preferred_width = aw.tables.PreferredWidth.from_points(250)
doc.save(file_name=ARTIFACTS_DIR + 'DocumentBuilder.SetRowFormatting.docx')
See Also
- module aspose.words.tables
- class Table