Column
Column class for “table:table-column” tag.
Classes:
| Name | Description |
|---|---|
Column |
Create a Column element, “table:table-column”. |
Column
Bases: Element
Create a Column element, “table:table-column”.
Methods:
| Name | Description |
|---|---|
__init__ |
Create a Column element, “table:table-column”. |
__repr__ |
|
get_default_cell_style |
Get the default cell style for the column. |
set_default_cell_style |
Set the default cell style for the column. |
Attributes:
| Name | Type | Description |
|---|---|---|
clone |
Column
|
Return a clone of the column. |
default_cell_style |
str | None
|
Get or set the default cell style for the column. |
repeated |
int | None
|
Get or set the number of times the column is repeated. |
style |
str | None
|
Get or set the style of the column itself. |
x |
int | None
|
|
Source code in odfdo/column.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
_tag
class-attribute
instance-attribute
_tag = 'table:table-column'
clone
property
clone: Column
Return a clone of the column.
default_cell_style
property
writable
default_cell_style: str | None
Get or set the default cell style for the column.
Returns:
| Type | Description |
|---|---|
str | None
|
str or None: The name of the default cell style, or None if not set. |
repeated
property
writable
repeated: int | None
Get or set the number of times the column is repeated.
This property is typically None when using the higher-level table API.
Returns:
| Type | Description |
|---|---|
int | None
|
int or None: The number of repetitions, or None if not repeated. |
style
property
writable
style: str | None
Get or set the style of the column itself.
Returns:
| Type | Description |
|---|---|
str | None
|
str or None: The name of the style applied to the column. |
x
instance-attribute
x: int | None = None
__init__
__init__(
default_cell_style: str | None = None,
repeated: int | None = None,
style: str | None = None,
**kwargs: Any,
) -> None
Create a Column element, “table:table-column”.
This constructor creates a column element with an optional style. The default cell style can be set for the entire column. If the properties apply to multiple columns, the number of repeated columns can be specified.
Columns do not contain cells themselves, but only styling information.
Note
It is generally not necessary to create columns by hand; the higher-level Table API should be used instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
default_cell_style
|
str | None
|
The name of the default style to apply to cells in this column. |
None
|
repeated
|
int | None
|
The number of times this column should be repeated. Must be greater than 1. |
None
|
style
|
str | None
|
The name of the style to apply to the column itself. |
None
|
kwargs
|
Any
|
Arbitrary keyword arguments for the Element base class. |
{}
|
Source code in odfdo/column.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
__repr__
__repr__() -> str
Source code in odfdo/column.py
82 83 | |
_set_repeated
_set_repeated(repeated: int | None) -> None
Set the number of times the column is repeated.
This is an internal method that sets the ‘table:number-columns-repeated’ attribute without triggering cache updates. Use None to remove the attribute.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
repeated
|
int | None
|
The number of times the column should be repeated. If None or less than 2, the attribute is removed. |
required |
Source code in odfdo/column.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
get_default_cell_style
get_default_cell_style() -> str | None
Get the default cell style for the column.
(See also the default_cell_style property.)
Returns:
| Type | Description |
|---|---|
str | None
|
str or None: The name of the default cell style, or None if not set. |
Source code in odfdo/column.py
92 93 94 95 96 97 98 99 100 101 | |
set_default_cell_style
set_default_cell_style(style: Style | str | None) -> None
Set the default cell style for the column.
(See also the default_cell_style property.)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
style
|
Style | str | None
|
The style to apply. Can be a Style object, the name of a style, or None to remove the style. |
required |
Source code in odfdo/column.py
103 104 105 106 107 108 109 110 111 112 113 | |