Paper Office
paper-docxAPI referencetable

_Row

paper-docx 0.2.0 API reference

Table row.

_Row(tr: CT_Row, parent: TableParent)

Attributes

cells

attributecellstuple[_Cell, ...]

Sequence of _Cell instances corresponding to cells in this row.

Note that Word allows table rows to start later than the first column and end before the last column.

  • Only cells actually present are included in the return value.
  • This implies the length of this cell sequence may differ between rows of the same table.
  • If you are reading the cells from each row to form a rectangular "matrix" data structure of the table cell values, you will need to account for empty leading and/or trailing layout-grid positions using .grid_cols_before and .grid_cols_after.

grid_cols_after

attributegrid_cols_afterint

Count of unpopulated grid-columns after the last cell in this row.

Word allows a row to "end early", meaning that one or more cells are not present at the end of that row.

Note these are not simply "empty" cells. The renderer reads this value and "skips" this many columns after drawing the last cell.

Note this also implies that not all rows are guaranteed to have the same number of cells, e.g. _Row.cells could have length n for one row and n - m for the next row in the same table. Visually this appears as a column (at the beginning or end, not in the middle) with one or more cells missing.

grid_cols_before

attributegrid_cols_beforeint

Count of unpopulated grid-columns before the first cell in this row.

Word allows a row to "start late", meaning that one or more cells are not present at the beginning of that row.

Note these are not simply "empty" cells. The renderer reads this value and skips forward to the table layout-grid position of the first cell in this row; the renderer "skips" this many columns before drawing the first cell.

Note this also implies that not all rows are guaranteed to have the same number of cells, e.g. _Row.cells could have length n for one row and n - m for the next row in the same table.

height

attributeheightLength | None

Return a Length object representing the height of this cell, or None if no explicit height is set.

height_rule

attributeheight_ruleWD_ROW_HEIGHT_RULE | None

Return the height rule of this cell as a member of the :ref:WdRowHeightRule.

This value is None if no explicit height_rule is set.

part

attributepartXmlPart

The package part containing this object.

table

attributetableTable

Reference to the Table object this row belongs to.

On this page