Skip to content

Row Group

RowGroup class for “table:table-row-group” tag.

Classes:

Name Description
RowGroup

A group of rows with common properties, “table:table-row-group”.

RowGroup

Bases: Element

A group of rows with common properties, “table:table-row-group”.

Partial implementation.

The “table:table-row-group” element groups adjacent table rows. Every row group can contain header rows, and nested row groups. A row group can be visible or hidden.

Methods:

Name Description
__init__

Initialize a RowGroup element (table:table-row-group).

__repr__
Source code in odfdo/row_group.py
34
35
36
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
class RowGroup(Element):
    """A group of rows  with common properties, "table:table-row-group".

    Partial implementation.

    The "table:table-row-group" element groups adjacent table rows. Every row
    group can contain header rows, and nested row groups. A row group can be
    visible or hidden.
    """

    # TODO
    _tag = "table:table-row-group"

    def __init__(
        self,
        height: int | None = None,
        width: int | None = None,
        **kwargs: Any,
    ) -> None:
        """Initialize a RowGroup element (`table:table-row-group`).

        This element can be optionally pre-filled with a specified number
        of rows and cells.

        Args:
            height: The number of rows to create within the group.
            width: The number of cells to create in each new row.
            **kwargs: Additional keyword arguments for the parent `Element` class.
        """
        super().__init__(**kwargs)
        if self._do_init and height is not None:
            for _i in range(height):
                row = Row(width=width)
                self.append(row)

    def __repr__(self) -> str:
        return f"<{self.__class__.__name__}>"

_tag class-attribute instance-attribute

_tag = 'table:table-row-group'

__init__

__init__(
    height: int | None = None,
    width: int | None = None,
    **kwargs: Any,
) -> None

Initialize a RowGroup element (table:table-row-group).

This element can be optionally pre-filled with a specified number of rows and cells.

Parameters:

Name Type Description Default
height int | None

The number of rows to create within the group.

None
width int | None

The number of cells to create in each new row.

None
**kwargs Any

Additional keyword arguments for the parent Element class.

{}
Source code in odfdo/row_group.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
def __init__(
    self,
    height: int | None = None,
    width: int | None = None,
    **kwargs: Any,
) -> None:
    """Initialize a RowGroup element (`table:table-row-group`).

    This element can be optionally pre-filled with a specified number
    of rows and cells.

    Args:
        height: The number of rows to create within the group.
        width: The number of cells to create in each new row.
        **kwargs: Additional keyword arguments for the parent `Element` class.
    """
    super().__init__(**kwargs)
    if self._do_init and height is not None:
        for _i in range(height):
            row = Row(width=width)
            self.append(row)

__repr__

__repr__() -> str
Source code in odfdo/row_group.py
69
70
def __repr__(self) -> str:
    return f"<{self.__class__.__name__}>"