XjJ<dZddlmZddlmZmZmZddlmZm 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:tcc8|j}|y|jSzCThe number of unpopulated layout-grid cells at the end of this row.r)r: grid_afterselfr:s r2r=zCT_Row.grid_after?syy <r1c8|j}|y|jSzEThe number of unpopulated layout-grid cells at the start of this row.r)r: grid_beforer>s r2rBzCT_Row.grid_beforeGs!yy <r1c||jz }|jD]!}|dkrn|dk(r|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=)rBr8 grid_span ValueError)r? grid_offsetremaining_offsettcs r2tc_at_grid_offsetzCT_Row.tc_at_grid_offsetOsf ')9)99++ -B!#1$   ,  -:;-HIIr1cttt|j}|jj |S)z?Index of this `w:tr` element within its parent `w:tbl` element.)rCT_Tbl getparenttr_lstindex)r?tbls r2tr_idxz CT_Row.tr_idxds,64>>+,zz%%r1c8|j}|y|jS)zFThe value of `./w:trPr/w:trHeight/@w:hRule`, or |None| if not present.N)r:trHeight_hRuler>s r2rRzCT_Row.trHeight_hRulejs!yy <"""r1c2|j}||_yN)r6rRr?valuer:s r2rRzCT_Row.trHeight_hRulers##%#r1c8|j}|y|jS)zHReturn the value of `w:trPr/w:trHeight@w:val`, or |None| if not present.N)r: trHeight_valr>s r2rXzCT_Row.trHeight_valws!yy <   r1c2|j}||_yrT)r6rXrUs r2rXzCT_Row.trHeight_vals##%!r1c(|jd|yNrinsert)r?r9s r2_insert_tblPrExzCT_Row._insert_tblPrExs Awr1ch|j}||j|y|jd|yr[)r9addnextr])r?r:r9s r2 _insert_trPrzCT_Row._insert_trPrs+,,   OOD ! KK4 r1c*tjSrT)CT_Tcnewr?s r2_new_tczCT_Row._new_tcsyy{r1Nreturnint)rFrirhrcrhr)rVr)rVr')r9 CT_TblPrEx)r:CT_TrPr)r+r,r-r.r/rr9r:rrHpropertyr=rBrIrPrRsetterrXr^rarfr0r1r2r4r41s **$$ !*;!7G 7$X.D.. F B   J*&& ##$$!!"" !r1r4cJeZdZUdZded<ded<edZded<ed Zd ed <ed Z e dd Z e jddZ e dZ dZeddZe ddZejddZeddZeddZed dZeddZy)!rKz```` element.zCallable[[], CT_Row]add_trz list[CT_Row]rMzw:tblPrCT_TblPrtblPrz w:tblGrid CT_TblGridtblGridzw:trcL|jj}|y|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()r?rxs r2bidiVisual_valzCT_Tbl.bidiVisual_vals& ZZ**  ~~r1c~|j}||jyt||j_yrT)rt_remove_bidiVisualboolget_or_add_bidiVisualr()r?rVrts r2ryzCT_Tbl.bidiVisual_vals1  =  $ $ &04U E ' ' ) -r1c@t|jjS)z)The number of grid columns in this table.)lenrv gridCol_lstres r2 col_countzCT_Tbl.col_counts4<<++,,r1c#XK|jD]}|jD]}|yw)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)rMr8)r?trrHs r2iter_tcszCT_Tbl.iter_tcss3++ Bii   s(*c Vttt|j|||S)zReturn a new `w:tbl` element having `rows` rows and `cols` columns. `width` is distributed evenly between the columns. )rrKr _tbl_xml)clsrowscolswidths r2new_tblzCT_Tbl.new_tbls# FIcll4u&EFGGr1cL|jj}|y|jS)zH`w:tblPr/w:tblStyle/@w:val` (a table style id) or |None| if not present.N)rttblStyler(r?rs r2 tblStyle_valzCT_Tbl.tblStyle_vals&::&&  ||r1cl|j}|j|y||j_y)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()r?styleIdrts r2rzCT_Tbl.tblStyle_vals2    ? $+!r1c |dkDrt||zn td}dtdd|j|||j|||dS)Nrz z )rr _tblGrid_xml_trs_xml)rrrr col_widths r2rzCT_Tbl._tbl_xmlsa*.(C &A gcl^$i01||D$ 23  r1cXd}t|D]}|d|jzz }|dz }|S)Nz z z )rangetwips)rrrxml_s r2rzCT_Tbl._tblGrid_xmlsAy! CA 09??B BC C !! r1c4d|j||d|zS)Nz z )_tcs_xml)r row_countrrs r2rzCT_Tbl._trs_xmls"CLLI>?{KiWWr1c(d|jd|zS)Nz; )r)rrrs r2rzCT_Tbl._tcs_xmls+009/@A   r1N)rhz bool | None)rVzWD_TABLE_DIRECTION | None)rrirrirrrhrKrh str | None)rrrhNone)rrirrirrrhstr)rrirrrhr)rrirrirrrhr)r+r,r-r.r/rrtrvrrroryrprr classmethodrrrrrrr0r1r2rKrKs  #I.E8.' 4GZ4 F B <<-- HH , ,    XXr1rKc:eZdZUdZded<ded<eddZy ) 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/rgridColr0r1r2rurus" -,$$1EFGr1ruc@eZdZUdZedeZded<eddZ y) CT_TblGridColzB`w:gridCol` element, child of `w:tblGrid`, defines a table column.w:wr'rcttt|j}|jj |S)zHIndex of this `w:gridCol` element within its parent `w:tblGrid` element.)rrurLrrN)r?rvs r2 gridCol_idxzCT_TblGridCol.gridCol_idxs.z4>>#34""((..r1Nrg) r+r,r-r.rrrr/rorr0r1r2rrs/L( A}//r1rc.eZdZUdZedeZded<y)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/r0r1r2rrs  )"D*r1rceZdZUdZded<ded<ded<ded <d ed <d ed <d ed <dZededdZded<ededdZded<ededdZ ded<ededdZ ded <[e d'd!Z e jd(d"Z e d)d#Zejd*d$Ze d%Zejd+d&Zy),rsz}```` element, child of ````, holds child elements that define table properties such as style and borders.zCallable[[], CT_OnOff]r}zCallable[[], 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 | Nonerxrz CT_Jc | Nonejcr zCT_TblLayoutType | None tblLayoutcL|j}|ytd|jS)zAHorizontal alignment of table, |None| if `./w:jc` is not present.NWD_TABLE_ALIGNMENT | None)rrr()r?rs r2 alignmentzCT_TblPr.alignmentWs'WW :/88r1cl|j|y|j}td||_y)Nr )rrrr()r?rVrs r2rzCT_TblPr.alignment_s1  =     !*E2r1c@|j}|dS|jdk7S)zg|False| when there is a `w:tblLayout` child with `@w:type="fixed"`. Otherwise |True|. Tfixed)rr)r?rs r2autofitzCT_TblPr.autofitgs& NN  (tGinn.GGr1cF|j}|rd|_yd|_y)Nrr)rr)r?rVrs r2rzCT_TblPr.autofitps--/ &+  r1c8|j}|y|jS)ziReturn the value of the ``val`` attribute of the ```` child or |None| if not present.N)rr(rs r2stylezCT_TblPr.styleus ==  ||r1cT|j|y||j_yrT)rrr(r?rVs r2rzCT_TblPr.style~s'  = #( r1)rhr)rVrrhr|)rVr|rVr)r+r,r-r.r/_tag_seqrrrxrrrorrprrr0r1r2rsrs)s?321&&88****""((H("+!""H#,8AB<#J!8AB<B *3(23-*I&  9933HH ^^99 \\))r1rsceZdZdZy)rmz`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.r0r1r2rmrmsr1rmcxeZdZUdZedeZded<edeZ e d dZ e jd dZ y) CT_TblWidthzJUsed for `w:tblW` and `w:tcW` and others, specifies a table-related width.rrirrcL|jdk7ryt|jS)z>EMU length indicated by the combined `w:w` and `w:type` attrs.dxaN)rrrres r2rzCT_TblWidth.widths! 99 TVV}r1cFd|_t|j|_y)Nr)rrrrrs r2rzCT_TblWidth.widths U!!r1Nrhr'rVr) r+r,r-r.rrrr/rrrorrpr0r1r2rrsNT uf -As- X{ 3D   \\""r1rceZdZUdZded<ded<ded<ded <d ed <ded <ed Zded<edZedZ e d6dZ dZ e d6dZ e d6dZejd7dZe d8dZdZe d6dZd9dZed:dZe d6dZe d6dZe d;dZejdd!Zd?d"Zd@dAd$ZdBd%Ze dCd&Zd?d'ZdDd(Ze dEd)Z d*Z!d+Z"dFd,Z#dGd-Z$dHd.Z%e dId/Z&e d:d0Z'e dEd1Z(e dJd2Z)e dJd3Z*e dKd4Z+e d6d5Z,y#)Lrcz`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:tblc|j7|j}|)|jtjk(r |jS|j dzS)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. r)vMerge _tc_belowrCONTINUEbottom_tr_idx)r?tc_belows r2rz CT_Tc.bottomsG ;; "~~H#8;L;L(L&||ar1cR|jdD]}|j|y)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)r?es r2 clear_contentzCT_Tc.clear_contents(45 A KKN r1cz|jj}td|jdD}||zS)zStarting offset of `tc` in the layout-grid columns of its table. A cell in the leftmost grid-column has offset 0. c34K|]}|jywrT)rD).0rHs r2 z$CT_Tc.grid_offset..s& BLL& sz./preceding-sibling::w:tc)_trrBsumr)r?rBpreceding_tc_grid_spanss r2rFzCT_Tc.grid_offsetsC hh** "%& #'::.I#J& # 444r1c:|j}|dS|jS)zzThe integer number of columns this cell spans. Determined by ./w:tcPr/w:gridSpan/@val, it defaults to 1. r)rrDr?rs r2rDzCT_Tc.grid_spans yyLq4dnn4r1c2|j}||_yrT)rrDr?rVrs r2rDzCT_Tc.grid_spans##%r1c$|jdS)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:tblrres r2inner_content_elementszCT_Tc.inner_content_elementsszz+,,r1c#Ktdtdtdf}|D]}|j|vs|yw)zpGenerate a reference to each of the block-level content elements in this cell, in the order they appear.rrzw:sdtN)r tag)r?block_item_tagschilds r2iter_block_itemszCT_Tc.iter_block_itemss@e9bk2g;? EyyO+  s4>>c|jS)z?The grid column index at which this ```` element appears.)rFres r2leftz CT_Tc.leftsr1c|j|\}}}}|jj|j|}|j |||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_tblrMrI_grow_to)r?other_tctoprheightrtop_tcs r2mergez CT_Tc.mergesO $(#8#8#B T65!!#&88>v& r1c LtttdtdzS)zUA new `w:tc` element, containing an empty paragraph as the required EG_BlockLevelElt.zr)rrcr r )rs r2rdz CT_Tc.news E9%= %LMNNr1c4|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. )rFrDres r2rightz CT_Tc.right s$..00r1c|j|jtjk(r |jS|jj S)z9The top-most row index in the vertical span of this cell.)rrRESTARTr _tc_abover res r2r z CT_Tc.tops9 ;; $++1A1A"A<< ~~!!!r1c8|j}|y|jS)zCValue of ./w:tcPr/w:vMerge/@val, |None| if w:vMerge is not present.N)r vMerge_valrs r2rz CT_Tc.vMergesyy <r1c2|j}||_yrT)rrrs r2rz CT_Tc.vMerge%s##%r1c8|j}|y|jS)zDEMU length represented in `./w:tcPr/w:tcW` or |None| if not present.N)rrrs r2rz CT_Tc.width*syy <zzr1c2|j}||_yrT)rrrs r2rz CT_Tc.width2s##% r1c|jr5|jr(t|j|jz|_yyy)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)r?r s r2 _add_width_ofzCT_Tc._add_width_of7s1 ::(.. X^^ ;.vMerge_valFs@%!! Q;  %%  r1Nr)rrc)_span_to_widthrr )r?rrrrrs` ` r2r zCT_Tc._grow_to?sc  V E6:f+=> A:~~H' ''   eVaZ 8 r1c*|jd||S)z#Override default `._insert_tcPr()`.rr\rs r2 _insert_tcPrzCT_Tc._insert_tcPrVs At r1ct|j}t|dkDry|d}t|txrt|j dk(S)z=True if this cell contains only a single empty `w:p` element.rFr)listrr isinstancerr_lst)r? block_items only_items r2 _is_emptyzCT_Tc._is_empty]sR40023 { a  N )T*Hs9??/Cq/HHr1c||ury|jry|j|jD]}|j||j|j y)zxAppend the content of this cell to `other_tc`. Leaves this cell with a single empty ```` element. N)r*_remove_trailing_empty_prappendr)r?r  block_elements r2_move_content_tozCT_Tc._move_content_tohs] t   >> ))+!224 +M OOM * + DKKM"r1ctd)NzDuse CT_Tbl.new_tbl() to add a new table, specifying rows and columns)NotImplementedErrorres r2_new_tblzCT_Tc._new_tblxs! R  r1c6|jd}|r|dSdS)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)r? following_tcss r2_next_tczCT_Tc._next_tc}s% #>? #0}Q:d:r1cN|j}|J|j|y)z-Remove this `w:tc` element from the XML tree.N)rLr)r?parent_elements r2_removez CT_Tc._removes())))d#r1ct|j}|d}t|tsy|}t |j dkDry|j |y)zJRemove last content element from this cell if it's an empty `w:p` element.Nr)r%rr&rrr'r)r?r(last_content_elmps r2r,zCT_Tc._remove_trailing_empty_psP40023 &r?*D1   qww.raise_on_inverted_Ls_uu~!((ahh"6&'GHHvvAGGqww$6&'GHH%7r1c|j|jkr||fn||f\}}|j|jkr$|j|jkDr td|j|jkr||fn||f\}}|j|jkr%|j|jkDr tdyyr?r@)rArBtop_mostother left_mosts r2raise_on_tee_shapedz3CT_Tc._span_dimensions..raise_on_tee_shapeds() q!fAq6OHe||eii'HOOell,J&'GHH)*!&&1vq!f Iu~~ *y/L&'GHH0M*r1)rArcrBrc)minr rmaxrr)r?r rCrHr rrrs r2r zCT_Tc._span_dimensionss  I  I D(+D(+$((HLL)499hmm,T[[(//2DJJ/D&3, 44r1c|j||j|kr"|j|||j|kr"||_y)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)r/rD_swallow_next_tcr)r? grid_widthrrs r2r!zCT_Tc._span_to_widthsC f%nnz)  ! !*f 5nnz) r1cdfd }j}|||J|j|j|xj|jz c_|j y)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. cn| tdj|jzkDr tdy)Nznot enough grid columnszspan is not rectangular)r rD)next_tcrMr?s r2raise_on_invalid_swallowz8CT_Tc._swallow_next_tc..raise_on_invalid_swallows<&'@AA~~ 1 11J>&'@AA?r1N)rP CT_Tc | None)r5r/rrDr8)r?rMrrQrPs`` r2rLzCT_Tc._swallow_next_tcsb B -- )"""  ( 7# '+++r1cFtt|jddS)z+The tbl element this tc element appears in.z./ancestor::w:tbl[position()=1]r)rrKrres r2r z CT_Tc._tbls FDJJ'HI!LMMr1cL|jj|jS)zAThe `w:tc` element immediately above this one in its grid column.) _tr_aboverIrFres r2rzCT_Tc._tc_aboves~~//0@0@AAr1cV|j}|y|j|jS)z=The tc element immediately below this one in its grid column.N) _tr_belowrIrF)r?tr_belows r2rzCT_Tc._tc_belows->>  ))$*:*:;;r1cFtt|jddS)z*The tr element this tc element appears in.z./ancestor::w:tr[position()=1]r)rr4rres r2rz CT_Tc._trs FDJJ'GHKLLr1cH|jd}|s td|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)rrE)r? tr_abovess r2rUzCT_Tc._tr_aboves, JJZ[ >? ?|r1c|jj}|j|j} ||dzS#t$rYywxYw)zzThe tr element next in sequence after the tr this cell appears in, or |None| if this cell appears in the last row.rN)r rMrNr IndexError)r?rMrPs r2rWzCT_Tc._tr_belowsK!!dhh' &1*% %  s; AAc`|jjj|jS)z;The row index of the tr element this tc element appears in.)r rMrNrres r2rz CT_Tc._tr_idx s#yy%%dhh//r1rgrVri)rhzlist[CT_P | CT_Tbl])r rcrhrc)rhrcrrrr)r rcrT)rrirrirrR)rCT_TcPrrhr`r)rhr)rhrR)r rcrhztuple[int, int, int, int])rMrirrcrr)rMrirrc)rhrK)rhr4)rhz CT_Row | None)-r+r,r-r.r/rrrr<rOrorrrFrDrprrrrrrdrr rrrr r#r*r/r2r5r8r,r r!rLr rrrrUrWrr0r1r2rcrcs]$ **  ++ %X.D..%A G C       5 555--   OO11""  ]]   \\=9.II#  ;; $ 5<"2NNBB<<MM00r1rcceZdZUdZded<ded<ded<ded <d ed <d ed <d ed <dZededdZded<ededdZded<ededdZ ded<ededdZ ded <[e d)d!Z e jd*d"Z e d#Zejd+d$Ze d%Zejd,d&Ze d-d'Zejd.d(Zy)/r`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:tcPrChangerjNrzCT_TblWidth | NonetcWrkCT_DecimalNumber | NonegridSpanrlzCT_VMerge | Nonerrm zCT_VerticalJc | NonevAlignc:|j}|dS|jS)zsThe integer number of columns this cell spans. Determined by ./w:gridSpan/@val, it defaults to 1. r)rrr()r?rrs r2rDzCT_TcPr.grid_span=s! ==$q6(,,6r1cZ|j|dkDr||j_yyr )rfrbr(rs r2rDzCT_TcPr.grid_spanFs+  19-2D $ $ & * r1c8|j}|y|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)rur()r?rus r2 vAlign_valzCT_TcPr.vAlign_valLs >zzr1cT||jy||j_yrT)rgrdr(rs r2ryzCT_TcPr.vAlign_valXs' =    ! ', $r1c8|j}|y|jS)zeThe value of the ./w:vMerge/@val attribute, or |None| if the w:vMerge element is not present.N)rr()r?rs r2rzCT_TcPr.vMerge_val_s >zzr1cT|j|||j_yyrT)rhrer(rs r2rzCT_TcPr.vMerge_valhs*   %*D    " r1c8|j}|y|jS)zJEMU length in `./w:tcW` or |None| if not present or its type is not 'dxa'.N)ror)r?ros r2rz CT_TcPr.widthnshh ;yyr1c2|j}||_yrT)rcr)r?rVros r2rz CT_TcPr.widthvs!!# r1rgr_)rVz!WD_CELL_VERTICAL_ALIGNMENT | Nonerrr)r+r,r-r.r/rrrorrrrurorDrpryrrr0r1r2r`r`sk?77--22((((&&&&H((HQRLC )2!")H% )x| F $-x}$F   7733   -- ++  \\r1r`c eZdZUdZded<dZededdZd ed <ed ed dZd ed <ededdZ ded<[e ddZ e ddZ e ddZ e jddZ e dZejddZy)rnz4```` element, defining table row properties.zCallable[[], CT_Height]get_or_add_trHeight)rizw:divId w:gridBefore w:gridAfterz w:wBeforezw:wAfterz w:cantSplit w:trHeightz w:tblHeaderrrzw:hiddenzw:inszw:delz w:trPrChangerrNrrq gridAfterrrp gridBeforerrzCT_Height | NonetrHeightc:|j}|dS|jSr<)rr()r?rs r2r=zCT_TrPr.grid_afters!NN %q89==8r1c:|j}|dS|jSrA)rr()r?rs r2rBzCT_TrPr.grid_befores!__ &q:JNN:r1c:|j}|dS|jS)zCReturn the value of `w:trHeight@w:hRule`, or |None| if not present.N)rr*r?rs r2rRzCT_TrPr.trHeight_hRules!=='t;X^^;r1cP| |jy|j}||_yrT)rrr*r?rVrs r2rRzCT_TrPr.trHeight_hRules( =T]]2 ++-r1c:|j}|dS|jS)zAReturn the value of `w:trHeight@w:val`, or |None| if not present.N)rr(rs r2rXzCT_TrPr.trHeight_vals!=='t9X\\9r1cP| |jy|j}||_yrT)rrr(rs r2rXzCT_TrPr.trHeight_vals( =T]]2 ++- r1rgrjrkrl)r+r,r-r.r/rrrrrror=rBrRrprXr0r1r2rnrn|s>00H"*3(12,*I&+48AB<+J'"+!""H  99 ;; <<  :: r1rnc.eZdZUdZedeZded<y) CT_VerticalJcz:`w:vAlign` element, specifying vertical alignment of cell.r&rr(N)r+r,r-r.rrr(r/r0r1r2rrsD&7+'C #r1rcFeZdZUdZedeej Zded<y) CT_VMergezG```` element, specifying vertical merging behavior of a cell.r&)defaultrr(N) r+r,r-r.rrrr(r/r0r1r2rrs#Q'8#4#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%r4rKrurrrsrmrrcr`rnrrr0r1r2rs("00^^,$&-*+*214+^_^Bn_nb G G /O /  Z)Z)z"/",h0Oh0V ioiXEoEPOr1