wordpress hit counter
Define a fixed height for a table - .Net - Development Tools - OpenXML Developer

Define a fixed height for a table

Development Tools

Discussions about working with Open XML using a wide range of development tools

Define a fixed height for a table

  • rated by 0 users
  • This post has 4 Replies |
  • 3 Followers
  • Hello,

     

    What do I expect ?

    I want to define a fixed height to a table (or a div with fxied height like in html)  so that my document has always the same look whatever the number of lines by table. My table has a dynamic number of rows.

    This is my document structure:

    Page 1

    logo                                  

      Libelle1

      Libelle 2     

    Table 1

        Libelle 3    

     

    Page2

    logo                                  

      Libelle1

      Libelle 2     

    Table 2

        Libelle 3   

     

    For example my Libelle 3 has to be 6 centimeters under the beginning of each table. My logo has to be 4 centimeters under the page header.

    My document contains several tables with some other kind of content between each other.

     

    I loop on a xml template to create my table and i concatenate the content to the rest of my document.

    This is the xml row template i use for each table: 

     

     <w:tr wsp:rsidR="005828C8" wsp:rsidTr="00511ADA"><w:tc><w:tcPr><w:tcW w:w="5245" w:type="dxa"/><w:tcBorders><w:top w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" 
              w:color="000000"/><w:left w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" w:color="000000"/><w:bottom w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" w:color="000000"/>
              <w:right w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" w:color="000000"/></w:tcBorders></w:tcPr><w:p wsp:rsidR="000565D3" wsp:rsidRDefault="00217039"><w:r>
              <w:t></w:t></w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w="1134" w:type="dxa"/><w:tcBorders><w:top w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0"
               w:color="000000"/><w:left w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" w:color="000000"/><w:bottom w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" w:color="000000"/>
               <w:right w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" w:color="000000"/></w:tcBorders></w:tcPr><w:p wsp:rsidR="000565D3" wsp:rsidRDefault="00217039" wsp:rsidP="00511ADA">
               <w:pPr><w:jc w:val="center"/></w:pPr><w:r><w:t></w:t></w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w="1559" w:type="dxa"/><w:tcBorders>
               <w:top w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" w:color="000000"/><w:left w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" w:color="000000"/><w:bottom 
               w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" w:color="000000"/><w:right w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" w:color="000000"/></w:tcBorders></w:tcPr>
               <w:p wsp:rsidR="000565D3" wsp:rsidRDefault="00217039" wsp:rsidP="00511ADA"><w:pPr><w:jc w:val="right"/></w:pPr><w:r><w:t> €
               </w:t></w:r></w:p></w:tc><w:tc><w:tcPr><w:tcW w:w="1385" w:type="dxa"/><w:tcBorders><w:top w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" w:color="000000"/>
               <w:left w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" w:color="000000"/><w:bottom w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" w:color="000000"/>
               <w:right w:val="single" w:sz="2" wx:bdrwidth="5" w:space="0" w:color="000000"/></w:tcBorders></w:tcPr><w:p wsp:rsidR="000565D3" wsp:rsidRDefault="00217039" wsp:rsidP="00511ADA">
               <w:pPr><w:jc w:val="right"/></w:pPr><w:r><w:t> €</w:t></w:r></w:p></w:tc></w:tr>

     

    What happened?

    Without fixed height, my document is not structured exacty the same between each page. Because the logo does not start 

    4 centimeters under the header for the second page.

     

  • I want to include a table inside a div element so that whatever the number of rows of my table, my document is always structured the same way.

    How can I do that?

    The second solution would be to define a fixed height directly to the table but i can't find how.

    Thank you very much

  • I'm not entirely clear about what you want, but it seems like your logo should probably be in a header if you need it to be in the same place on each page.

  • Hi  jdesreumaux,

            It would be helpful if you could create an example word document describing your requirement and attach it here.

  • Thanks for you replies.

    I bypass the problem by inserting a page break after the libelle3  between each page.

Page 1 of 1 (5 items)