Remove all content elements, preserving `w:tcPr` element if present. Note that this leaves the `w:tc` element in an invalid state because it doesn't contain at least one block-level element. It's up to the caller to add a `w:p`child element as the last content element.
(self)
| 447 | return self._tr_idx + 1 |
| 448 | |
| 449 | def clear_content(self): |
| 450 | """Remove all content elements, preserving `w:tcPr` element if present. |
| 451 | |
| 452 | Note that this leaves the `w:tc` element in an invalid state because it doesn't |
| 453 | contain at least one block-level element. It's up to the caller to add a |
| 454 | `w:p`child element as the last content element. |
| 455 | """ |
| 456 | # -- remove all cell inner-content except a `w:tcPr` when present. -- |
| 457 | for e in self.xpath("./*[not(self::w:tcPr)]"): |
| 458 | self.remove(e) |
| 459 | |
| 460 | @property |
| 461 | def grid_offset(self) -> int: |