;iJdZddlmZddlmZmZmZddlmZm Z m Z ddl m Z ddl mZmZddlmZddlmZdd lmZmZmZmZmZdd lmZdd lmZmZmZm Z m!Z!m"Z"m#Z#dd l$m%Z%m&Z&m'Z'erdd lm(Z(ddl)m*Z*ddlm+Z+m,Z,ddl-m.Z.GddeZ/GddeZ0GddeZ1GddeZ2GddeZ3GddeZ4GddeZ5Gdd eZ6Gd!d"eZ7Gd#d$eZ8Gd%d&eZ9Gd'd(eZ:Gd)d*eZ;Gd+d,eZ`` element.zCallable[[], CT_Tc]add_tczCallable[[], CT_TrPr]get_or_add_trPr _add_trPrz list[CT_Tc]tc_lstz w:tblPrExzCT_TblPrEx | NonetblPrExzw:trPrzCT_TrPr | NonetrPrzw:tcreturnintc&|j}|dS|jSzCThe number of unpopulated layout-grid cells at the end of this row.Nr)r: grid_afterselfr:s r2r?zCT_Row.grid_after?sy <1r1c&|j}|dS|jSzEThe number of unpopulated layout-grid cells at the start of this row.Nr)r: grid_beforer@s r2rDzCT_Row.grid_beforeGsy <1r1 grid_offsetCT_Tcc||jz }|jD]}|dkrn|dkr|cS||jz}td|)zThe `tc` element in this tr at exact `grid offset`. Raises ValueError when this `w:tr` contains no `w:tc` with exact starting `grid_offset`. rzno `tc` element at grid_offset=)rDr8 grid_span ValueError)rArEremaining_offsettcs r2tc_at_grid_offsetzCT_Row.tc_at_grid_offsetOsp ')99+ - -B!##1$$   ,  H;HHIIIr1ctt|}|j|S)z?Index of this `w:tr` element within its parent `w:tbl` element.)rCT_Tbl getparenttr_lstindex)rAtbls r2tr_idxz CT_Row.tr_idxds364>>++,,z%%%r1r)c&|j}|dS|jS)zFThe value of `./w:trPr/w:trHeight/@w:hRule`, or |None| if not present.N)r:trHeight_hRuler@s r2rUzCT_Row.trHeight_hRulejsy <4""r1valuec<|}||_dSN)r6rUrArVr:s r2rUzCT_Row.trHeight_hRulers!##%%#r1c&|j}|dS|jS)zHReturn the value of `w:trPr/w:trHeight@w:val`, or |None| if not present.N)r: trHeight_valr@s r2r[zCT_Row.trHeight_valwsy <4  r1r'c<|}||_dSrX)r6r[rYs r2r[zCT_Row.trHeight_vals!##%%!r1 CT_TblPrExc2|d|dSNrinsert)rAr9s r2_insert_tblPrExzCT_Row._insert_tblPrExs Awr1CT_TrPrcr|j}|||dS|d|dSr_)r9addnextra)rAr:r9s r2 _insert_trPrzCT_Row._insert_trPrsA,   OOD ! ! ! ! ! KK4 r1c4tSrX)rFnewrAs r2_new_tczCT_Row._new_tcsyy{{r1Nr;r<)rEr<r;rFr;r)rVr)rVr')r9r])r:rc)r+r,r-r.r/rr9r:rrKpropertyr?rDrLrSrUsetterr[rbrfrjr0r1r2r4r41s****$$$$!*;!7!7G7777$9X..D.... F  B X   X JJJJ*&&&X& ###X#$$$$!!X!""""    !!!!r1r4ceZdZUdZded<ded<edZded<ed Zd ed <ed Z e d)dZ e j d*dZ e dZ dZed+dZe d,dZej d-dZed.d!Zed/d$Zed0d&Zed/d'Zd(S)1rNz```` element.zCallable[[], CT_Row]add_trz list[CT_Row]rPzw:tblPrCT_TblPrtblPrz w:tblGrid CT_TblGridtblGridzw:trr; bool | Nonec0|jj}|dS|jS)zValue of `./w:tblPr/w:bidiVisual/@w:val` or |None| if not present. Controls whether table cells are displayed right-to-left or left-to-right. N)rt bidiVisualr()rArys r2bidiVisual_valzCT_Tbl.bidiVisual_vals! Z*  4~r1rVWD_TABLE_DIRECTION | Nonec|j}||dSt||_dSrX)rt_remove_bidiVisualboolget_or_add_bidiVisualr()rArVrts r2rzzCT_Tbl.bidiVisual_valsF  =  $ $ & & & & &04U E ' ' ) ) - - -r1c4t|jjS)z)The number of grid columns in this table.)lenrv gridCol_lstris r2 col_countzCT_Tbl.col_counts4<+,,,r1c#:K|jD]}|jD]}|VdS)zGenerate each of the `w:tc` elements in this table, left to right and top to bottom. Each cell in the first row is generated, followed by each cell in the second row, etc. N)rPr8)rAtrrKs r2iter_tcszCT_Tbl.iter_tcssD+  Bi     r1rowsr<colswidthrc pttt||||S)zReturn a new `w:tbl` element having `rows` rows and `cols` columns. `width` is distributed evenly between the columns. )rrNr _tbl_xml)clsrrrs r2new_tblzCT_Tbl.new_tbls, FIcll4u&E&EFFGGGr1 str | Nonec0|jj}|dS|jS)zH`w:tblPr/w:tblStyle/@w:val` (a table style id) or |None| if not present.N)rttblStyler(rArs r2 tblStyle_valzCT_Tbl.tblStyle_vals!:&  4|r1styleIdNonecv|j}||dS||_dS)zSet the value of `w:tblPr/w:tblStyle/@w:val` (a table style id) to `styleId`. If `styleId` is None, remove the `w:tblStyle` element. N)rt_remove_tblStyle _add_tblStyler()rArrts r2rzCT_Tbl.tblStyle_valsA      ? F$+!!!r1strc |dkrt||zntd}dtdd|||||||dS)Nrz z )rr _tblGrid_xml_trs_xml)rrrr col_widths r2rzCT_Tbl._tbl_xmls*.((C &&&A  gcll  i00 ||D$ 22    r1rrcRd}t|D]}|d|jzz }|dz }|S)Nz z z )rangetwips)rrrxml_s r2rzCT_Tbl._tblGrid_xmlsDy!! C CA 09?B BCC !! r1 row_countc<d|||d|zS)Nz z )_tcs_xml)rrrrs r2rzCT_Tbl._trs_xmls&KCLLI>>KKKiWWr1cd|jd|zS)Nz; )r)rrrs r2rzCT_Tbl._tcs_xmls* 09     r1N)r;rw)rVr{)rr<rr<rrr;rNr;r)rrr;r)rr<rr<rrr;r)rr<rrr;r)rr<rr<rrr;r)r+r,r-r.r/rrtrvrrrorzrprr classmethodrrrrrrr0r1r2rNrNs    #mI..E....'- 44G4444 F  B X<<<<--X-   HHH[HX , , , ,    [  [XXX[X[r1rNcBeZdZUdZded<ded<eddZd S) ruzq`w:tblGrid` element. Child of `w:tbl`, holds `w:gridCol> elements that define column count, width, etc. zCallable[[], CT_TblGridCol] add_gridColzlist[CT_TblGridCol]rz w:gridCol)zw:tblGridChange successorsN)r+r,r-r.r/rgridColr0r1r2rurusI -,,,$$$$j1EFFFGGGr1rucNeZdZUdZedeZded<ed dZ dS) CT_TblGridColzB`w:gridCol` element, child of `w:tblGrid`, defines a table column.w:wr'rr;r<ctt|}|j|S)zHIndex of this `w:gridCol` element within its parent `w:tblGrid` element.)rrurOrrQ)rArvs r2 gridCol_idxzCT_TblGridCol.gridCol_idxs4z4>>#3#344"((...r1Nrk) r+r,r-r.rrrr/rorr0r1r2rrsgLL(( A///X///r1rc6eZdZUdZedeZded<dS)CT_TblLayoutTypez`w:tblLayout` element. Specifies whether column widths are fixed or can be automatically adjusted based on content. w:typertypeN)r+r,r-r.rrrr/r0r1r2rrsN )("Dr1rceZdZUdZded<ded<ded<ded <d ed <d ed <d ed <dZededdZded<ededdZded<ededdZ ded<ededdZ ded <[e d,d#Z e j d-d%Z e d.d'Zej d/d(Ze d)Zej d0d+ZdS)1rsz}```` element, child of ````, holds child elements that define table properties such as style and borders.zCallable[[], CT_OnOff]rzCallable[[], CT_Jc] get_or_add_jczCallable[[], CT_TblLayoutType]get_or_add_tblLayoutzCallable[[], CT_String]rCallable[[], None]r} _remove_jcr) w:tblStylezw:tblpPrz w:tblOverlap w:bidiVisualzw:tblStyleRowBandSizezw:tblStyleColBandSizezw:tblWw:jcw:tblCellSpacingzw:tblIndz w:tblBordersw:shd w:tblLayoutz w:tblCellMarz w:tblLookz w:tblCaptionzw:tblDescriptionz w:tblPrChangerNrzCT_String | NonerrzCT_OnOff | Noneryrz CT_Jc | Nonejcr zCT_TblLayoutType | None tblLayoutr;WD_TABLE_ALIGNMENT | NonecB|j}|dStd|jS)zAHorizontal alignment of table, |None| if `./w:jc` is not present.Nr)rrr()rArs r2 alignmentzCT_TblPr.alignmentWs(W :4/888r1rVc||dS|}td||_dS)Nr )rrrr()rArVrs r2rzCT_TblPr.alignment_sC  = F    ! !*E22r1r~c.|j}|dn |jdkS)zg|False| when there is a `w:tblLayout` child with `@w:type="fixed"`. Otherwise |True|. NTfixed)rr)rArs r2autofitzCT_TblPr.autofitgs! N  (ttin.GGr1cD|}|rdnd|_dS)Nrr)rr)rArVrs r2rzCT_TblPr.autofitps'--// &+8 r1c&|j}|dS|jS)ziReturn the value of the ``val`` attribute of the ```` child or |None| if not present.N)rr(rs r2stylezCT_TblPr.styleus=  4|r1rch||dS||_dSrX)rrr(rArVs r2rzCT_TblPr.style~s8  = F#(   r1)r;r)rVrr;r~)rVr~rVr)r+r,r-r.r/_tag_seqrrryrrrorrprrr0r1r2rsrs)s+332111&&&&8888********""""((((H("+!"""""H#,)8ABB<###J!y8ABB<B*3(233-***I  999X93333HHHXH ^999^9X \)))\)))r1rsceZdZdZdS)r]z`w:tblPrEx` element, exceptions to table-properties. Applied at a lower level, like a `w:tr` to modify the appearance. Possibly used when two tables are merged. For more see: http://officeopenxml.com/WPtablePropertyExceptions.php N)r+r,r-r.r0r1r2r]r]sr1r]ceZdZUdZedeZded<edeZ e d dZ e j dd Z d S) CT_TblWidthzJUsed for `w:tblW` and `w:tcW` and others, specifies a table-related width.rr<rrr;r'cD|jdkrdSt|jS)z>EMU length indicated by the combined `w:w` and `w:type` attrs.dxaN)rrrris r2rzCT_TblWidth.widths$ 9  4TV}}r1rVrcFd|_t|j|_dS)Nr)rrrrrs r2rzCT_TblWidth.widths U!r1Nr;r'rVr) r+r,r-r.rrrr/rrrorrpr0r1r2rrsTT  uf - -A----  X{ 3 3D X  \"""\"""r1rc,eZdZUdZded<ded<ded<ded <d ed <ded <ed Zded<edZedZ e dKdZ dZ e dKdZ e dKdZejdLdZe dMdZdZe dKdZdNdZedOd Ze dKd!Ze dKd"Ze dPd$ZejdQd%Ze dRd'ZejdSd)ZdTd*ZdUdVd0ZdWd2Ze dXd4ZdTd5ZdYd7Ze dZd8Z d9Z!d:Z"d[d<Z#d\d?Z$d]d@Z%e d^dBZ&e dOdCZ'e dZdDZ(e d_dFZ)e d_dGZ*e d`dIZ+e dKdJZ,d+S)arFz`w:tc` table cell element.zCallable[[], CT_P]add_pzCallable[[], CT_TcPr]get_or_add_tcPrz list[CT_P]p_lstz list[CT_Tbl]tbl_lstzCallable[[CT_Tbl], CT_Tbl] _insert_tbl_new_pzw:tcPrzCT_TcPr | NonetcPrw:pw:tblr;r<cn|j%|j}||jtjkr|jS|jdzS)zThe row index that marks the bottom extent of the vertical span of this cell. This is one greater than the index of the bottom-most row of the span, similar to how a slice of the cell's rows would be specified. Nr)vMerge _tc_belowrCONTINUEbottom_tr_idx)rAtc_belows r2rz CT_Tc.bottoms= ; "~H#8;L(L(L&|ar1c`|dD]}||dS)a/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. z./*[not(self::w:tcPr)]N)xpathremove)rAes r2 clear_contentzCT_Tc.clear_contents;455  A KKNNNN  r1c||jj}td|dD}||zS)zStarting offset of `tc` in the layout-grid columns of its table. A cell in the leftmost grid-column has offset 0. c3$K|] }|jV dSrX)rH).0rKs r2 z$CT_Tc.grid_offset..s5& & BL& & & & & & r1z./preceding-sibling::w:tc)_trrDsumr)rArDpreceding_tc_grid_spanss r2rEzCT_Tc.grid_offsetsU h* "%& & #'::.I#J#J& & & # # 444r1c&|j}|dn|jS)zzThe integer number of columns this cell spans. Determined by ./w:tcPr/w:gridSpan/@val, it defaults to 1. Nr)rrHrArs r2rHzCT_Tc.grid_spans yLqqdn4r1rVc<|}||_dSrX)rrHrArVrs r2rHzCT_Tc.grid_spans##%%r1list[CT_P | CT_Tbl]c,|dS)zGenerate all `w:p` and `w:tbl` elements in this document-body. Elements appear in document order. Elements shaded by nesting in a `w:ins` or other "wrapper" element will not be included. z./w:p | ./w:tblrris r2inner_content_elementszCT_Tc.inner_content_elementsszz+,,,r1c#Ktdtdtdf}|D]}|j|vr|VdS)zpGenerate a reference to each of the block-level content elements in this cell, in the order they appear.rrzw:sdtN)r tag)rAblock_item_tagschilds r2iter_block_itemszCT_Tc.iter_block_itemssVe99bkk2g;;?  EyO++   r1c|jS)z?The grid column index at which this ```` element appears.)rEris r2leftz CT_Tc.lefts r1other_tcc||\}}}}|jj||}||||S)zReturn top-left `w:tc` element of a new span. Span is formed by merging the rectangular region defined by using this tc element and `other_tc` as diagonal corners. )_span_dimensions_tblrPrL_grow_to)rAr topr heightrtop_tcs r2mergez CT_Tc.mergesV $(#8#8#B#B T65!#&88>>v&&& r1c ftttdtdzS)zUA new `w:tc` element, containing an empty paragraph as the required EG_BlockLevelElt.zr)rrFr r )rs r2rhz CT_Tc.news(E9%= %LMMNNNr1c |j|jzS)aThe grid column index that marks the right-side extent of the horizontal span of this cell. This is one greater than the index of the right-most column of the span, similar to how a slice of the cell's columns would be specified. )rErHris r2rightz CT_Tc.right s$.00r1c`|j|jtjkr|jS|jjS)z9The top-most row index in the vertical span of this cell.)rrRESTARTr _tc_aboverris r2rz CT_Tc.tops. ; $+1A"A"A< ~!!r1rc&|j}|dS|jS)zCValue of ./w:tcPr/w:vMerge/@val, |None| if w:vMerge is not present.N)r vMerge_valrs r2rz CT_Tc.vMergesy <4r1c<|}||_dSrX)rrrs r2rz CT_Tc.vMerge%s##%%r1r'c&|j}|dS|jS)zDEMU length represented in `./w:tcPr/w:tcW` or |None| if not present.N)rrrs r2rz CT_Tc.width*sy <4zr1rc<|}||_dSrX)rrrs r2rz CT_Tc.width2s##%% r1cl|jr*|jr%t|j|jz|_dSdSdS)zAdd the width of `other_tc` to this cell. Does nothing if either this tc or `other_tc` does not have a specified width. N)rr)rAr s r2 _add_width_ofzCT_Tc._add_width_of7sG : =(. = X^ ;<.vMerge_valFs8%%!!Q;;T%  r1Nr)rrF)_span_to_widthrr)rArrrrrs` ` r2rzCT_Tc._grow_to?s        V E6::f+=+=>>> A::~H'''   eVaZ 8 8 8 8 8 :r1CT_TcPrc2|d||S)z#Override default `._insert_tcPr()`.rr`rs r2 _insert_tcPrzCT_Tc._insert_tcPrVs At r1r~ct|}t|dkrdS|d}t|tot|jdkS)z=True if this cell contains only a single empty `w:p` element.rFr)listrr isinstancerr_lst)rA block_items only_items r2 _is_emptyzCT_Tc._is_empty]sd4002233 {  a  5 N )T**Hs9?/C/Cq/HHr1c||urdS|jrdS||D]}||||dS)zxAppend the content of this cell to `other_tc`. Leaves this cell with a single empty ```` element. N)r/_remove_trailing_empty_prappendr)rAr  block_elements r2_move_content_tozCT_Tc._move_content_tohs t   F >  F))+++!2244 + +M OOM * * * * DKKMM"""""r1rc td)NzDuse CT_Tbl.new_tbl() to add a new table, specifying rows and columns)NotImplementedErrorris r2_new_tblzCT_Tc._new_tblxs! R   r1cD|d}|r|dndS)zThe `w:tc` element immediately following this one in this row, or |None| if this is the last `w:tc` element in the row.z./following-sibling::w:tcrNr)rA following_tcss r2_next_tczCT_Tc._next_tc}s+ #>?? #0:}Qd:r1c`|}|J||dS)z-Remove this `w:tc` element from the XML tree.N)rOr)rAparent_elements r2_removez CT_Tc._removes7)))))d#####r1ct|}|d}t|tsdS|}t |jdkrdS||dS)zJRemove last content element from this cell if it's an empty `w:p` element.Nr)r*rr+rrr,r)rAr-last_content_elmps r2r1zCT_Tc._remove_trailing_empty_psm4002233 &r?*D11  F  qw<.raise_on_inverted_Lsfu~~!(ah"6"6&'GHHHvAGqw$6$6&'GHHH $6$6r1c2|j|jkr||fn||f\}}|j|jkr|j|jkrtd|j|jkr||fn||f\}}|j|jkr|j|jkrtddSdSrGrH)rDrEtop_mostother left_mosts r2raise_on_tee_shapedz3CT_Tc._span_dimensions..raise_on_tee_shapeds() q!ffAq6OHe|ei''HOel,J,J&'GHHH)*!&1vvq!f Iu~ **y/L/L&'GHHH+*/L/Lr1)rDrFrErF)minrr maxrr)rAr rIrNrr rrs r2r zCT_Tc._span_dimensionss  I I I I  I I I I D(+++D(+++$(HL))49hm,,T[(/22DJ//D&3, 44r1 grid_widthrc|||j|kr!||||j|k!||_dS)aIncorporate `w:tc` elements to the right until this cell spans `grid_width`. Incorporated `w:tc` elements are removed (replaced by gridSpan value). Raises |ValueError| if `grid_width` cannot be exactly achieved, such as when a merged cell would drive the span width greater than `grid_width` or if not enough grid columns are available to make this cell that wide. All content from incorporated cells is appended to `top_tc`. The val attribute of the vMerge element on the single remaining cell is set to `vMerge`. If `vMerge` is |None|, the vMerge element is removed if present. N)r4rH_swallow_next_tcr)rArQrrs r2r%zCT_Tc._span_to_widthsU f%%%nz))  ! !*f 5 5 5nz)) r1cdfd }j}|||J|||xj|jz c_|dS)aExtend the horizontal span of this `w:tc` element to incorporate the following `w:tc` element in the row and then delete that following `w:tc` element. Any content in the following `w:tc` element is appended to the content of `top_tc`. The width of the following `w:tc` element is added to this one, if present. Raises |InvalidSpanError| if the width of the resulting cell is greater than `grid_width` or if there is no next `` element in the row. next_tcr!cn|tdj|jzkrtddS)Nznot enough grid columnszspan is not rectangular)r rH)rUrQrAs r2raise_on_invalid_swallowz8CT_Tc._swallow_next_tc..raise_on_invalid_swallowsC&'@AAA~ 11J>>&'@AAA?>r1N)rUr!)r:r4r rHr=)rArQrrWrUs`` r2rSzCT_Tc._swallow_next_tcs B B B B B B B -  )))"""  ((( 7### '++r1rNc^tt|ddS)z+The tbl element this tc element appears in.z./ancestor::w:tbl[position()=1]r)rrNrris r2rz CT_Tc._tbls&FDJJ'HII!LMMMr1c@|j|jS)zAThe `w:tc` element immediately above this one in its grid column.) _tr_aboverLrEris r2rzCT_Tc._tc_aboves~//0@AAAr1cL|j}|dS||jS)z=The tc element immediately below this one in its grid column.N) _tr_belowrLrE)rAtr_belows r2rzCT_Tc._tc_belows->  4))$*:;;;r1r4c^tt|ddS)z*The tr element this tc element appears in.z./ancestor::w:tr[position()=1]r)rr4rris r2rz CT_Tc._trs&FDJJ'GHHKLLLr1c^|d}|std|dS)zThe tr element prior in sequence to the tr this cell appears in. Raises |ValueError| if called on a cell in the top-most row. z9./ancestor::w:tr[position()=1]/preceding-sibling::w:tr[1]zno tr above topmost tr in w:tblr)rrI)rA tr_abovess r2rZzCT_Tc._tr_aboves8 JJZ[[  @>?? ?|r1 CT_Row | Nonec|jj}||j} ||dzS#t$rYdSwxYw)zzThe tr element next in sequence after the tr this cell appears in, or |None| if this cell appears in the last row.rN)rrPrQr IndexError)rArPrSs r2r\zCT_Tc._tr_belowsW!dh'' &1*% %   44 s 3 AAcJ|jj|jS)z;The row index of the tr element this tc element appears in.)rrPrQrris r2rz CT_Tc._tr_idx sy%%dh///r1rkrVr<)r;r)r rFr;rF)r;rFrrrr)r rFrX)rr<rr<rr!)rr&r;r&r)r;r)r;r!)r rFr;rB)rQr<rrFrr)rQr<rrF)r;rN)r;r4)r;ra)-r+r,r-r.r/rrrrArRrorrrErHrprrr rrrhrrrrr rr(r/r4r7r:r=r1r r%rSrrrrrZr\rr0r1r2rFrFsn$$****++++%9X..D.... %A )G  C     X      5 5 5X 5555X5---X-   X     OOO[O111X1"""X" X ]   ] X \\====99999.IIIXI####     ;;;X; $$$   5555<"2NNNXNBBBXB<<<X<MMMXMXX000X000r1rFceZdZUdZded<ded<ded<ded <d ed <d ed <d ed <dZededdZded<ededdZded<ededdZ ded<ededdZ ded <[e d0d#Z e j d1d%Z e d&Zej d2d(Ze d)Zej d3d+Ze d4d-Zej d5d/ZdS)6r&z5```` element, defining table cell properties.zCallable[[], CT_DecimalNumber]get_or_add_gridSpanzCallable[[], CT_TblWidth]get_or_add_tcWzCallable[[], CT_VerticalJc]get_or_add_vAlignzCallable[[], CT_VMerge] _add_vMerger_remove_gridSpan_remove_vAlign_remove_vMerge) w:cnfStylew:tcW w:gridSpanzw:hMergew:vMergez w:tcBordersrzw:noWrapzw:tcMarzw:textDirectionz w:tcFitTextw:vAlignz w:hideMarkz w:headersz w:cellInsz w:cellDelz w:cellMergez w:tcPrChangeroNrzCT_TblWidth | NonetcWrpCT_DecimalNumber | NonegridSpanrqzCT_VMerge | Nonerrr zCT_VerticalJc | NonevAlignr;r<c&|j}|dn|jS)zsThe integer number of columns this cell spans. Determined by ./w:gridSpan/@val, it defaults to 1. Nr)rwr()rArws r2rHzCT_TcPr.grid_span=s =$qq(,6r1rVcp||dkr||_dSdSr$)rkrgr(rs r2rHzCT_TcPr.grid_spanFs>  199-2D $ $ & & * * * 9r1c&|j}|dS|jS)zValue of `w:val` attribute on `w:vAlign` child. Value is |None| if `w:vAlign` child is not present. The `w:val` attribute on `w:vAlign` is required. N)rzr()rArzs r2 vAlign_valzCT_TcPr.vAlign_valLs >4zr1!WD_CELL_VERTICAL_ALIGNMENT | Nonech||dS||_dSrX)rlrir(rs r2r~zCT_TcPr.vAlign_valXs8 =    ! ! ! F',  $$$r1c&|j}|dS|jS)zeThe value of the ./w:vMerge/@val attribute, or |None| if the w:vMerge element is not present.N)rr()rArs r2rzCT_TcPr.vMerge_val_s >4zr1rch||||_dSdSrX)rmrjr(rs r2rzCT_TcPr.vMerge_valhs<   %*D     " " "  r1r'c&|j}|dS|jS)zJEMU length in `./w:tcW` or |None| if not present or its type is not 'dxa'.N)rtr)rArts r2rz CT_TcPr.widthnsh ;4yr1rc<|}||_dSrX)rhr)rArVrts r2rz CT_TcPr.widthvs!!## r1rkre)rVrrrr)r+r,r-r.r/rrrtrwrrzrorHrpr~rrr0r1r2r&r&sb??7777----2222((((((((&&&&&&&&H((iHQRRLC)2 !"")))H )yx|   F$-9x}$$$F  777X73333   X ---- X++++ X \\r1r&cbeZdZUdZded<dZededdZd ed <ed ed dZd ed <ededdZ ded<[e ddZ e ddZ e ddZ e jddZ e dZejd dZdS)!rcz4```` element, defining table row properties.zCallable[[], CT_Height]get_or_add_trHeight)rnzw:divId w:gridBefore w:gridAfterz w:wBeforezw:wAfterz w:cantSplit w:trHeightz w:tblHeaderrrzw:hiddenzw:inszw:delz w:trPrChangerrNrrv gridAfterrru gridBeforerrzCT_Height | NonetrHeightr;r<c&|j}|dn|jSr>)rr()rArs r2r?zCT_TrPr.grid_aftersN %qq9=8r1c&|j}|dn|jSrC)rr()rArs r2rDzCT_TrPr.grid_befores_ &qqJN:r1r)c&|j}|dn|jS)zCReturn the value of `w:trHeight@w:hRule`, or |None| if not present.N)rr*rArs r2rUzCT_TrPr.trHeight_hRules='ttX^;r1rVcR| |jdS|}||_dSrX)rrr*rArVrs r2rUzCT_TrPr.trHeight_hRules/ =T]2 F++--r1c&|j}|dn|jS)zAReturn the value of `w:trHeight@w:val`, or |None| if not present.N)rr(rs r2r[zCT_TrPr.trHeight_vals='ttX\9r1r'cR| |jdS|}||_dSrX)rrr(rs r2r[zCT_TrPr.trHeight_vals/ =T]2 F++-- r1rkrlrmrn)r+r,r-r.r/rrrrrror?rDrUrpr[r0r1r2rcrc|s>>0000H"*3(122,***I+4)8ABB<+++J"+!"""""H  999X9 ;;;X; <<<X<  ::X: r1rcc6eZdZUdZedeZded<dS) CT_VerticalJcz:`w:vAlign` element, specifying vertical alignment of cell.r&rr(N)r+r,r-r.rrr(r/r0r1r2rrsHDD&7&7+''Cr1rcDeZdZUdZedeejZded<dS) CT_VMergezG```` element, specifying vertical merging behavior of a cell.r&)defaultrr(N) r+r,r-r.rrrr(r/r0r1r2rrsQQQ''8#4Cr1rN)=r. __future__rtypingrrrdocx.enum.tablerrr docx.exceptionsr docx.oxml.nsr r docx.oxml.parserr docx.oxml.sharedrdocx.oxml.simpletypesrrrrrdocx.oxml.text.paragraphrdocx.oxml.xmlchemyrrrrrrr docx.sharedrrrrdocx.enum.textr r!r"docx.oxml.text.parfmtr#r%r4rNrurrrsr]rrFr&rcrrr0r1r2rse((""""""0000000000^^^^^^^^^^,,,,,,$$$$$$$$&&&&&&------*)))))+*********,22222211111144444444++++++^^^^^_^^^Bnnnnn_nnnb G G G G G G G G / / / / /O / / /        Z)Z)Z)Z)Z)Z)Z)Z)z"""""/""",h0h0h0h0h0Oh0h0h0V iiiiioiiiXEEEEEoEEEPOr1