|
| 1 | + |
| 2 | +Table Row |
| 3 | +========= |
| 4 | + |
| 5 | +A table row has certain properties such as height. |
| 6 | + |
| 7 | + |
| 8 | +Row.height |
| 9 | +---------- |
| 10 | + |
| 11 | +Candidate protocol:: |
| 12 | + |
| 13 | + >>> from docx.enum.table import WD_ROW_HEIGHT |
| 14 | + >>> row = table.add_row() |
| 15 | + >>> row |
| 16 | + <docx.table._Row object at 0x...> |
| 17 | + >>> row.height_rule |
| 18 | + None |
| 19 | + >>> row.height_rule = WD_ROW_HEIGHT.EXACTLY |
| 20 | + >>> row.height |
| 21 | + None |
| 22 | + >>> row.height = Pt(24) |
| 23 | + |
| 24 | + |
| 25 | +MS API |
| 26 | +------ |
| 27 | + |
| 28 | +https://msdn.microsoft.com/en-us/library/office/ff193915.aspx |
| 29 | + |
| 30 | +Methods |
| 31 | +~~~~~~~ |
| 32 | + |
| 33 | +* Delete() |
| 34 | +* SetHeight() |
| 35 | +* SetLeftIndent() |
| 36 | + |
| 37 | +Properties |
| 38 | +~~~~~~~~~~ |
| 39 | + |
| 40 | +* Alignment |
| 41 | +* AllowBreakAcrossPages |
| 42 | +* Borders |
| 43 | +* Cells |
| 44 | +* HeadingFormat |
| 45 | +* Height |
| 46 | +* HeightRule |
| 47 | +* Index |
| 48 | +* IsFirst |
| 49 | +* IsLast |
| 50 | +* LeftIndent |
| 51 | +* NestingLevel |
| 52 | +* Next |
| 53 | +* Previous |
| 54 | +* Shading |
| 55 | +* SpaceBetweenColumns |
| 56 | + |
| 57 | + |
| 58 | +WD_ROW_HEIGHT_RULE Enumeration |
| 59 | +------------------------------ |
| 60 | + |
| 61 | +Alias: WD_ROW_HEIGHT |
| 62 | + |
| 63 | +* wdRowHeightAtLeast (1) The row height is at least a minimum specified value. |
| 64 | +* wdRowHeightAuto (0) The row height is adjusted to accommodate the tallest |
| 65 | + value in the row. |
| 66 | +* wdRowHeightExactly (2) The row height is an exact value. |
| 67 | + |
| 68 | + |
| 69 | +Schema Definitions |
| 70 | +------------------ |
| 71 | + |
| 72 | +.. highlight:: xml |
| 73 | + |
| 74 | +:: |
| 75 | + |
| 76 | + <xsd:complexType name="CT_Tbl"> <!-- denormalized --> |
| 77 | + <xsd:sequence> |
| 78 | + <xsd:group ref="EG_RangeMarkupElements" minOccurs="0" maxOccurs="unbounded"/> |
| 79 | + <xsd:element name="tblPr" type="CT_TblPr"/> |
| 80 | + <xsd:element name="tblGrid" type="CT_TblGrid"/> |
| 81 | + <xsd:choice minOccurs="0" maxOccurs="unbounded"> |
| 82 | + <xsd:element name="tr" type="CT_Row"/> |
| 83 | + <xsd:element name="customXml" type="CT_CustomXmlRow"/> |
| 84 | + <xsd:element name="sdt" type="CT_SdtRow"/> |
| 85 | + <xsd:group ref="EG_RunLevelElts" minOccurs="0" maxOccurs="unbounded"/> |
| 86 | + </xsd:choice> |
| 87 | + </xsd:sequence> |
| 88 | + </xsd:complexType> |
| 89 | + |
| 90 | + <xsd:complexType name="CT_Row"> |
| 91 | + <xsd:sequence> |
| 92 | + <xsd:element name="tblPrEx" type="CT_TblPrEx" minOccurs="0"/> |
| 93 | + <xsd:element name="trPr" type="CT_TrPr" minOccurs="0"/> |
| 94 | + <xsd:group ref="EG_ContentCellContent" minOccurs="0" maxOccurs="unbounded"/> |
| 95 | + </xsd:sequence> |
| 96 | + <xsd:attribute name="rsidRPr" type="ST_LongHexNumber"/> |
| 97 | + <xsd:attribute name="rsidR" type="ST_LongHexNumber"/> |
| 98 | + <xsd:attribute name="rsidDel" type="ST_LongHexNumber"/> |
| 99 | + <xsd:attribute name="rsidTr" type="ST_LongHexNumber"/> |
| 100 | + </xsd:complexType> |
| 101 | + |
| 102 | + <xsd:complexType name="CT_TrPr"> <!-- denormalized --> |
| 103 | + <xsd:sequence> |
| 104 | + <xsd:element name="cnfStyle" type="CT_Cnf" minOccurs="0"/> |
| 105 | + <xsd:element name="divId" type="CT_DecimalNumber" minOccurs="0"/> |
| 106 | + <xsd:element name="gridBefore" type="CT_DecimalNumber" minOccurs="0"/> |
| 107 | + <xsd:element name="gridAfter" type="CT_DecimalNumber" minOccurs="0"/> |
| 108 | + <xsd:element name="wBefore" type="CT_TblWidth" minOccurs="0"/> |
| 109 | + <xsd:element name="wAfter" type="CT_TblWidth" minOccurs="0"/> |
| 110 | + <xsd:element name="cantSplit" type="CT_OnOff" minOccurs="0"/> |
| 111 | + <xsd:element name="trHeight" type="CT_Height" minOccurs="0"/> |
| 112 | + <xsd:element name="tblHeader" type="CT_OnOff" minOccurs="0"/> |
| 113 | + <xsd:element name="tblCellSpacing" type="CT_TblWidth" minOccurs="0"/> |
| 114 | + <xsd:element name="jc" type="CT_JcTable" minOccurs="0"/> |
| 115 | + <xsd:element name="hidden" type="CT_OnOff" minOccurs="0"/> |
| 116 | + <xsd:element name="ins" type="CT_TrackChange" minOccurs="0"/> |
| 117 | + <xsd:element name="del" type="CT_TrackChange" minOccurs="0"/> |
| 118 | + <xsd:element name="trPrChange" type="CT_TrPrChange" minOccurs="0"/> |
| 119 | + </xsd:sequence> |
| 120 | + </xsd:complexType> |
| 121 | + |
| 122 | + <xsd:complexType name="CT_Height"> |
| 123 | + <xsd:attribute name="val" type="s:ST_TwipsMeasure"/> |
| 124 | + <xsd:attribute name="hRule" type="ST_HeightRule"/> |
| 125 | + </xsd:complexType> |
| 126 | + |
| 127 | + <xsd:simpleType name="ST_HeightRule"> |
| 128 | + <xsd:restriction base="xsd:string"> |
| 129 | + <xsd:enumeration value="auto"/> |
| 130 | + <xsd:enumeration value="exact"/> |
| 131 | + <xsd:enumeration value="atLeast"/> |
| 132 | + </xsd:restriction> |
| 133 | + </xsd:simpleType> |
0 commit comments