File: table-row.rst

package info (click to toggle)
python-docx 1.1.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,904 kB
  • sloc: xml: 25,311; python: 23,028; makefile: 176
file content (133 lines) | stat: -rw-r--r-- 4,150 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
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

Table Row
=========

A table row has certain properties such as height.


Row.height
----------

Candidate protocol::

    >>> from docx.enum.table import WD_ROW_HEIGHT
    >>> row = table.add_row()
    >>> row
    <docx.table._Row object at 0x...>
    >>> row.height_rule
    None
    >>> row.height_rule = WD_ROW_HEIGHT.EXACTLY
    >>> row.height
    None
    >>> row.height = Pt(24)


MS API
------

https://msdn.microsoft.com/en-us/library/office/ff193915.aspx

Methods
~~~~~~~

* Delete()
* SetHeight()
* SetLeftIndent()

Properties
~~~~~~~~~~

* Alignment
* AllowBreakAcrossPages
* Borders
* Cells
* HeadingFormat
* Height
* HeightRule
* Index
* IsFirst
* IsLast
* LeftIndent
* NestingLevel
* Next
* Previous
* Shading
* SpaceBetweenColumns


WD_ROW_HEIGHT_RULE Enumeration
------------------------------

Alias: WD_ROW_HEIGHT

* wdRowHeightAtLeast (1) The row height is at least a minimum specified value.
* wdRowHeightAuto (0) The row height is adjusted to accommodate the tallest
  value in the row.
* wdRowHeightExactly (2) The row height is an exact value.


Schema Definitions
------------------

.. highlight:: xml

::

  <xsd:complexType name="CT_Tbl">  <!-- denormalized -->
    <xsd:sequence>
      <xsd:group    ref="EG_RangeMarkupElements"        minOccurs="0" maxOccurs="unbounded"/>
      <xsd:element name="tblPr"       type="CT_TblPr"/>
      <xsd:element name="tblGrid"     type="CT_TblGrid"/>
      <xsd:choice                                       minOccurs="0" maxOccurs="unbounded">
        <xsd:element name="tr"        type="CT_Row"/>
        <xsd:element name="customXml" type="CT_CustomXmlRow"/>
        <xsd:element name="sdt"       type="CT_SdtRow"/>
        <xsd:group    ref="EG_RunLevelElts"             minOccurs="0" maxOccurs="unbounded"/>
      </xsd:choice>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="CT_Row">
    <xsd:sequence>
      <xsd:element name="tblPrEx" type="CT_TblPrEx" minOccurs="0"/>
      <xsd:element name="trPr"    type="CT_TrPr"    minOccurs="0"/>
      <xsd:group    ref="EG_ContentCellContent"     minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
    <xsd:attribute name="rsidRPr" type="ST_LongHexNumber"/>
    <xsd:attribute name="rsidR"   type="ST_LongHexNumber"/>
    <xsd:attribute name="rsidDel" type="ST_LongHexNumber"/>
    <xsd:attribute name="rsidTr"  type="ST_LongHexNumber"/>
  </xsd:complexType>

  <xsd:complexType name="CT_TrPr">  <!-- denormalized -->
    <xsd:sequence>
      <xsd:element name="cnfStyle"       type="CT_Cnf"           minOccurs="0"/>
      <xsd:element name="divId"          type="CT_DecimalNumber" minOccurs="0"/>
      <xsd:element name="gridBefore"     type="CT_DecimalNumber" minOccurs="0"/>
      <xsd:element name="gridAfter"      type="CT_DecimalNumber" minOccurs="0"/>
      <xsd:element name="wBefore"        type="CT_TblWidth"      minOccurs="0"/>
      <xsd:element name="wAfter"         type="CT_TblWidth"      minOccurs="0"/>
      <xsd:element name="cantSplit"      type="CT_OnOff"         minOccurs="0"/>
      <xsd:element name="trHeight"       type="CT_Height"        minOccurs="0"/>
      <xsd:element name="tblHeader"      type="CT_OnOff"         minOccurs="0"/>
      <xsd:element name="tblCellSpacing" type="CT_TblWidth"      minOccurs="0"/>
      <xsd:element name="jc"             type="CT_JcTable"       minOccurs="0"/>
      <xsd:element name="hidden"         type="CT_OnOff"         minOccurs="0"/>
      <xsd:element name="ins"            type="CT_TrackChange"   minOccurs="0"/>
      <xsd:element name="del"            type="CT_TrackChange"   minOccurs="0"/>
      <xsd:element name="trPrChange"     type="CT_TrPrChange"    minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="CT_Height">
    <xsd:attribute name="val"   type="s:ST_TwipsMeasure"/>
    <xsd:attribute name="hRule" type="ST_HeightRule"/>
  </xsd:complexType>

  <xsd:simpleType name="ST_HeightRule">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="auto"/>
      <xsd:enumeration value="exact"/>
      <xsd:enumeration value="atLeast"/>
    </xsd:restriction>
  </xsd:simpleType>