allow_cell_spacing property
Table.allow_cell_spacing property
Gets or sets the “Allow spacing between cells” option.
@property
def allow_cell_spacing(self) -> bool:
...
@allow_cell_spacing.setter
def allow_cell_spacing(self, value: bool):
...
Examples
Shows how to enable spacing between individual cells in a table.
doc = aw.Document()
builder = aw.DocumentBuilder(doc=doc)
table = builder.start_table()
builder.insert_cell()
builder.write('Animal')
builder.insert_cell()
builder.write('Class')
builder.end_row()
builder.insert_cell()
builder.write('Dog')
builder.insert_cell()
builder.write('Mammal')
builder.end_table()
table.cell_spacing = 3
# Set the "AllowCellSpacing" property to "true" to enable spacing between cells
# with a magnitude equal to the value of the "CellSpacing" property, in points.
# Set the "AllowCellSpacing" property to "false" to disable cell spacing
# and ignore the value of the "CellSpacing" property.
table.allow_cell_spacing = allow_cell_spacing
doc.save(file_name=ARTIFACTS_DIR + 'Table.AllowCellSpacing.html')
# Adjusting the "CellSpacing" property will automatically enable cell spacing.
table.cell_spacing = 5
self.assertTrue(table.allow_cell_spacing)
See Also
- module aspose.words.tables
- class Table