ooodev.format.inner.direct.write.table.props.table_properties module
- class ooodev.format.inner.direct.write.table.props.table_properties.TableAlignKind(value)[source]
Bases:
EnumAn enumeration.
- AUTO = 6
The object uses the full space (for text tables only).
- CENTER = 2
The object is aligned at the middle.
- FROM_LEFT = 7
The left offset and the width of the object are defined.
For text tables this means that the tables position is defined by the left margin and the width.
- LEFT = 3
The object is aligned at the left side.
- MANUAL = 0
No hard alignment is applied.
- RIGHT = 1
The object is aligned at the right side.
- class ooodev.format.inner.direct.write.table.props.table_properties.TableProperties(*, name=None, width=None, left=None, right=None, above=None, below=None, align=None, relative=False)[source]
Bases:
StyleMultiTable options.
Table horizontal position can be modified in many ways. This class generally follow how value are entered into the Table Properties dialog box of writer.
name,aboveandbelowparameters values are accepted for all states.When
relativeisTruethe following are required.align=TableAlignKind.AUTO, Not supported. RaisesValueError.align=TableAlignKind.CENTER,widthandleftare required.align=TableAlignKind.FROM_LEFT,widthandleftare required.align=TableAlignKind.LEFT,widthorrightare required.align=TableAlignKind.MANUAL, Not supported. RaisesValueError.align=TableAlignKind.RIGHT,widthorleftare required.
When
relativeisFalsethe following are required.align=TableAlignKind.AUTO, no extra parameters are required.align=TableAlignKind.CENTER,widthorleftare required.align=TableAlignKind.FROM_LEFT,widthorleftare required.align=TableAlignKind.LEFT,widthorrightis required.align=TableAlignKind.MANUAL,width,leftandrightare required.align=TableAlignKind.RIGHT,widthorleftis required.
New in version 0.9.0.
- __init__(*, name=None, width=None, left=None, right=None, above=None, below=None, align=None, relative=False)[source]
Constructor
- Parameters:
name (str, optional) – Specifies frame name. Space are NOT allowed in names
width (TblAbsUnit, TblRelUnit, optional) – Specifies table Width.
left (TblAbsUnit, TblRelUnit, optional) – Specifies table Left.
right (TblAbsUnit, TblRelUnit, optional) – Specifies table Right.
above (TblAbsUnit, TblRelUnit, optional) – Specifies table spacing above.
below (TblAbsUnit, TblRelUnit, optional) – Specifies table spacing below.
align (TableAlignKind, optional) – Specifies table alignment.
relative (bool, optional) – Specifies if table horizontal values are in percentages or
mmunits.
- Raises:
ValueError – If name contains spaces.
- Return type:
None
- apply(obj, **kwargs)[source]
Applies styles to object
- Parameters:
obj (object) – UNO object.
- Return type:
None
- classmethod from_obj(obj)[source]
- classmethod from_obj(obj, **kwargs)
- classmethod from_obj(obj, **kwargs)
Gets instance from object
- Parameters:
obj (object) – UNO Object.
- Raises:
NotSupportedError – If
objis not supported.- Returns:
Instance that represents Table options.
- Return type:
- get_left_mm()[source]
Gets left in
mmunits.When class is constructed using relative values this method will still return
mmunits.- Return type:
UnitMM | None
Note
This method may return None if
apply()has not yet been called.
- get_right_mm()[source]
Gets right in
mmunits.When class is constructed using relative values this method will still return
mmunits.- Return type:
UnitMM | None
Note
This method may return None if
apply()has not yet been called.
- get_width_mm()[source]
Gets Width in
mmunits.When class is constructed using relative values this method will still return
mmunits.- Return type:
UnitMM | None
Note
This method may return None if
apply()has not yet been called.
- on_property_setting(source, event_args)[source]
Triggers for each property that is set
- Parameters:
source (Any) – Event Source.
event_args (KeyValueCancelArgs) – Event Args
- Return type:
None
- property prop_align: TableAlignKind | None
Gets Alignment value
- Return type:
TableAlignKind | None
- property prop_format_kind: FormatKind
Gets the kind of style
- Return type:
- property prop_left: UnitMM | Intensity | None
Gets left value.
- Returns:
When
relativeisTrueIntensityorNone; Otherwise,UnitMMor None.- Return type:
See also
- property prop_name: str | None
Gets/Sets name
- Return type:
str | None
- property prop_relative: bool
Gets relative value
- Return type:
bool