distance_right property

Table.distance_right property

Gets or sets distance between table right and the surrounding text, in points.

@property
def distance_right(self) -> float:
    ...

@distance_right.setter
def distance_right(self, value: float):
    ...

Examples

Shows how to set distance between table boundaries and text.

doc = aw.Document(file_name=MY_DIR + 'Table wrapped by text.docx')
table = doc.first_section.body.tables[0]
self.assertEqual(25.9, table.distance_top)
self.assertEqual(25.9, table.distance_bottom)
self.assertEqual(17.3, table.distance_left)
self.assertEqual(17.3, table.distance_right)
# Set distance between table and surrounding text.
table.distance_left = 24
table.distance_right = 24
table.distance_top = 3
table.distance_bottom = 3
doc.save(file_name=ARTIFACTS_DIR + 'Table.DistanceBetweenTableAndText.docx')

See Also