locked
Vertical cell borders in tables does not align when having mapped content controls within the table cell RRS feed

  • Question

  • Hi,

    I have two templates with mapped(to a CustomXml) rich text content controls within tables. The content controls in question are also locked down so that the user cannot remove them or edit them. As a side note, the document it's self has protected areas.

    As i said, i have two template. We can call them Template A and B.

    I have a rich text content control within Template A which the user can enter text into.
    This rich text content control lies within a table cell and is mapped to a CustomXml node.

    In template B i also have a rich text content control that lies within a table cell which you can see as the receiver of the text entered in template A. The difference between the two rich text content controls in template A and B is that in template B the rich text content control is locked down so that the user cannot edit or delete the content control.

    As you might have already figured out, when i open up template B i pull the data from template A rich text content control and place it within the CustomXml node mapped to the rich text content control within template B.

    All in all, text from template A is transfered to template B.

    My problem is that in template B where the rich text content control is locked down the right hand vertical cell border is not aligned with the rest of the table. I works fine if i allow editing in all my content controls and have no protection on the document.

    Here is an image of the problem

    In design mode:

    Happy for any suggestion that solves this :)

    Br,

    /Peter


    Peter

    Friday, January 9, 2015 2:41 PM

Answers

  • Hi Peter,

    I have not worked with CustomXML nodes so I can't speak to that. However, I have been fighting problems with shifting table rows in xml formatted documents and can share what I have learned/discovered and maybe in applies and helps in your situation.

    An xml formatted document is not the same across versions of Office, meaning 2007 xml is not the same as 2010 xml or 2011 xml or 2013 xml. Between these versions certain objects tend to shift in their location. I know from experience that graphic objects shift and if those objects happen to be in a table cell, the row containing the object shifts.

    The implication of this is when you take an xml document created with one version of Office and edited it on another version, when you save the edited document the object will shift.

    There is an early warning that this might happen and it comes in the active documents window title, where it says "Compatibility Mode". By the way, the compatibility mode definition has now expanded to not only mean binary versus xml formatting but now also includes xml to xml formatting differences. 

    The second potential warning of the shift may occur when you save. I say potential because if you have previously clicked the checkbox that says, "Don't warn me again" then you will not see the message that you are saving out of compatibility mode.

    When you save out of compatibility mode, which you may not even recognize that you are doing, is when the table rows, containing certain kinds of objects, shift. Again, I know this happens with picture type objects (tiff, jpg, gif, png, etc) but maybe it also is happening with CustomeXML node objects?

    The remedy is creating/converting all of your templates and master document into the various xml versions and using the appropriate one based on the machine where it is running. You should be able to automate this conversion on the end users machine if you have some smart initialization routine that automatically runs a document conversion on all masters and templates when they get installed.

    As I said at the beginning, I don't know for sure if this table row shifting scenario as I have described applies to your objects, but if it does, then hopefully something I've shared helps you figure out a workaround or solution.


    Kind Regards, Rich ... http://greatcirclelearning.com


    Monday, January 26, 2015 1:16 PM
  • Hi Peter:

    Thanks for the clarificaiton. Regarding your question, I found piece of KB article and quoted some related information which pasted below. Hope it's useful for you, and if I misunderstood anything, please let me know.

    "

    • Earlier      versions of Word align text inside tables with the text outside tables. In      Word 2013, tables respect the UI settings, and the text inside tables is      not forced to align with text outside the table. By default, tables are      constrained by the margin in Word 2013.
    • Word 2013 may shift tables slightly (the default amount is .08 inch) and make tables narrower. This behavior may cause lines to break earlier. This, in turn, makes cells taller and potentially causes the page to break earlier.

    "

    For detailed information, please refer to:KB2740483.

    • Marked as answer by Chloe Wang Thursday, February 26, 2015 3:56 PM
    Tuesday, February 10, 2015 7:54 AM

All replies

  • Hi Peter,

    Thanks for posting in MSDN forum.

    I am not familiar with Content control and I am trying to contact the others who is familiar with this. Also I will keep on research it and I would go back if there are any updates.

    Thanks for your understanding.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, January 12, 2015 12:57 PM
  • Hi,

    Thanks for your reply.

    I think i have figured it out. However, working with layouts, content controls and protection together seems somewhat fragile.

    As i said before, i have mapped my rich text content control to a CustomXml. This has given me a package xml which will be stored within

    my CustomXml. Here is the process of getting it to work:

    1) Removed the protection from my template

    2) Removed the rich text content control in question

    3) Removed the package xml stored within my CustomXml

    4) Fixed layout issues with my table

    5) Added my rich text content control again to the table

    6) Added default text to my rich text content control

    7) Added protection to my template again.

    8) In order for the table cell vertical lines to stay in line i needed to add 2 extra paragphs after my content control(don't know why but i guess this has something todo with the protection that i'm adding)

    The things that worries me is:

    1) If i'm to add any changes to the layout, do i really need to go through this process again?

    2) A user could remove my extra paragraphs ending up messing up the layout.

    Any thoughts on this?

    Br


    Peter

    Monday, January 12, 2015 2:49 PM
  • Hi Peter,

    Thanks for the workaround and detail information for this issue.

    To get more effective response, I would like to move it to Word IT Pro Discussions forum. There are more experts in that forum and you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.

    Hopt it is helpful.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, January 13, 2015 2:48 AM
  • Hi Peter A Johansson,

    To do further research on this issue, we want to have a look at the templates and the package xml. To protect your private information, you can send the files to our email address:

    ibsofc@microsoft.com

    Regards,

    Melon Chen
    TechNet Community Support


    It's recommended to download and install Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office programs.
    Wednesday, January 14, 2015 3:00 AM
  • Okay, great!

    I'll send you two copies of the template in question, one where i have fixed the layout issues and one where the layout issue occurs.
    The two examples here above is a bit missleading since this only shows the result of the problem that i have.
    I will send you the template that causes this behaviour.

    Br,

    /Peter


    Peter

    Thursday, January 15, 2015 10:23 AM
  • Hi,

    After compared the file structure of the two templates you sent, I found there were several differences. And I have narrowed down to below highlighted parts in w:document.xml.

    I modified the table property of “*** issues.docm” to be the same with “*** without issues.docm”, the cell border aligned correctly. However I haven’t found if protected view has anything to do with this or it affected the table layout in what ways.

    You may consider to set up a trusted location or make those documents trusted documents, so it will save you some trouble.

    • A file is opened from a trusted location will not open in protected view.
    • A file is considered a trusted document will not open in protected view.

    <*** With issues.docm>

          <w:gridSpan w:val="2"/>

          <w:tcBorders>

           <w:top w:val="single" w:sz="6" w:space="0" w:color="auto"/>

           <w:bottom w:val="single" w:sz="4" w:space="0" w:color="auto"/>

           <w:right w:val="single" w:sz="6" w:space="0" w:color="auto"/>

          </w:tcBorders>

         </w:tcPr>

         <w:p w:rsidR="00813C46" w:rsidRPr="00BB78E9" w:rsidRDefault="00813C46" w:rsidP="00A25046">

          <w:pPr>

           <w:pStyle w:val="Default4"/>

           <w:rPr>

            <w:b/>

           </w:rPr>

          </w:pPr>

          <w:r w:rsidRPr="00BB78E9">

           <w:rPr>

            <w:b/>

           </w:rPr>

           <w:t>

            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

           </w:t>

          </w:r>

         </w:p>

        </w:tc>

       </w:tr>

       <w:tr w:rsidR="00813C46" w:rsidRPr="00FC53F0" w:rsidTr="00A25046">

        <w:trPr>

         <w:trHeight w:hRule="exact" w:val="166"/>

        </w:trPr>

        <w:tc>

         <w:tcPr>

          <w:tcW w:w="10251" w:type="dxa"/>

          <w:gridSpan w:val="5"/>

    <*** Without issues.docm>      

       

     <w:tcBorders>

           <w:top w:val="single" w:sz="6" w:space="0" w:color="auto"/>

           <w:bottom w:val="single" w:sz="4" w:space="0" w:color="auto"/>

           <w:right w:val="single" w:sz="6" w:space="0" w:color="auto"/>

          </w:tcBorders>

         </w:tcPr>

         <w:p w:rsidR="007D3792" w:rsidRPr="00BB78E9" w:rsidRDefault="007D3792" w:rsidP="001563CB">

          <w:pPr>

           <w:pStyle w:val="Default4"/>

           <w:rPr>

            <w:b/>

           </w:rPr>

          </w:pPr>

          <w:r w:rsidRPr="00BB78E9">

           <w:rPr>

            <w:b/>

           </w:rPr>

           <w:t>

            Anmärkning/Viktiga iakttagelser

           </w:t>

          </w:r>

         </w:p>

        </w:tc>

       </w:tr>

       <w:tr w:rsidR="007D3792" w:rsidRPr="00FC53F0" w:rsidTr="001563CB">

        <w:trPr>

         <w:trHeight w:hRule="exact" w:val="227"/>

        </w:trPr>

        <w:tc>

         <w:tcPr>

          <w:tcW w:w="10251" w:type="dxa"/>

          <w:gridSpan w:val="4"/>

    After deleting <w:gridSpan w:val="2"/> and modifying <w:gridSpan w:val="5"/> to <w:gridSpan w:val="4"/> the cell border aligned correctly. Sadly 

    <w:sdt checkbox="t" checkboxfontchecked="MS Gothic" checkboxfontunchecked="MS Gothic" checkboxischecked="f" checkboxvaluechecked="☒" checkboxvalueunchecked="☐" id="321012654" prefixmappings="xmlns:ns0='http://schemas.riksrevisionen.se/template/fsb' xmlns:ns1='http://schemas.riksrevisionen.se/template/ap' " sdttag="isWithoutRemark" storeitemid="X_06A07418-A3B7-4FB4-8AA5-779AE8C42A29" title="isWithoutRemark" xpath="/ns0:Document[1]/ns0:Content[1]/ns0:Conclusion[1]/ns0:IsWithoutRemark[1]">   </w:sdt><w:sdt checkbox="t" checkboxfontchecked="MS Gothic" checkboxfontunchecked="MS Gothic" checkboxischecked="t" checkboxvaluechecked="☒" checkboxvalueunchecked="☐" id="-418175780" prefixmappings="xmlns:ns0='http://schemas.riksrevisionen.se/template/fsb' xmlns:ns1='http://schemas.riksrevisionen.se/template/ap' " sdttag="hasRemark" storeitemid="X_06A07418-A3B7-4FB4-8AA5-779AE8C42A29" title="hasRemark" xpath="/ns0:Document[1]/ns0:Content[1]/ns0:Conclusion[1]/ns0:HasRemark[1]">   </w:sdt>

    ********

      

    <w:sdtpr></w:sdtpr>

      

    *****************

      

    <w:sdtpr></w:sdtpr>

      

    ****************

    ************************

    <w:sdt docpart="641F605CDC354D40B616451A83C5F4A7" id="1556275524" prefixmappings="xmlns:ns0='http://schemas.riksrevisionen.se/template/fsb' xmlns:ns1='http://schemas.riksrevisionen.se/template/fsb/openquestion' xmlns:ns2='http://schemas.riksrevisionen.se/template/ap/observation' xmlns:ns3='http://schemas.riksrevisionen.se/template/ap/openquestion' " sdttag="observationComment" storeitemid="X_06A07418-A3B7-4FB4-8AA5-779AE8C42A29" xpathrichtext="/ns0:Document[1]/ns0:Content[1]/ns0:Conclusion[1]/ns0:Comment[1]">  

    **************************<w:sdtpr></w:sdtpr>

      

    ***********

      

    **********************************************************

      

    </w:sdt>

    Regards,

    Melon Chen
    TechNet Community Support


    It's recommended to download and install Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office programs.
    Monday, January 19, 2015 1:42 AM
  • Hi,

    Thanks for your reply!

    I do see what you mean by changing the gridSpan to 4. However, if i change the gridSpan(by draging the line correct visually in word), save the template and then open it again, the vertical line of the table cell is once again not align with the rest of the table. The only work around that i found was to remove the content control and then correct the table cell(as described above).

    In you reply above you mention "Sadly", perhaps you meant to describe something more?

    So my question is, do i really need to remove the content control and THEN apply my design changes?

    Br,
    /Peter 


    Peter

    Tuesday, January 20, 2015 2:24 PM
  • Hi Peter,

    You mentioned the issue only occured when pretect view and content control worked together, have you tried setting a trusted location for those templates or making these templates trusted document? Let's try and see if it can get rid of the layout issue then.

    Regards,

    Melon Chen

    Forum Support


    Come back and mark the replies as answers if they help and unmark them if they provide no help.

    If you have any feedback on our support, please click here
    Thursday, January 22, 2015 1:33 AM
  • Are you suggesting that i should skip the current way of protection and use trusted location instead?
    The problem with that is we need to make sure that the user cannot edit the header part of the document(the blue area of the document) and  that leaves us with the option of marking the portion of the document that the user WILL be able to edit, thus we need to add protection to the document.

    Br

    Peter


    Peter

    Monday, January 26, 2015 9:42 AM
  • Hi Peter,

    I have not worked with CustomXML nodes so I can't speak to that. However, I have been fighting problems with shifting table rows in xml formatted documents and can share what I have learned/discovered and maybe in applies and helps in your situation.

    An xml formatted document is not the same across versions of Office, meaning 2007 xml is not the same as 2010 xml or 2011 xml or 2013 xml. Between these versions certain objects tend to shift in their location. I know from experience that graphic objects shift and if those objects happen to be in a table cell, the row containing the object shifts.

    The implication of this is when you take an xml document created with one version of Office and edited it on another version, when you save the edited document the object will shift.

    There is an early warning that this might happen and it comes in the active documents window title, where it says "Compatibility Mode". By the way, the compatibility mode definition has now expanded to not only mean binary versus xml formatting but now also includes xml to xml formatting differences. 

    The second potential warning of the shift may occur when you save. I say potential because if you have previously clicked the checkbox that says, "Don't warn me again" then you will not see the message that you are saving out of compatibility mode.

    When you save out of compatibility mode, which you may not even recognize that you are doing, is when the table rows, containing certain kinds of objects, shift. Again, I know this happens with picture type objects (tiff, jpg, gif, png, etc) but maybe it also is happening with CustomeXML node objects?

    The remedy is creating/converting all of your templates and master document into the various xml versions and using the appropriate one based on the machine where it is running. You should be able to automate this conversion on the end users machine if you have some smart initialization routine that automatically runs a document conversion on all masters and templates when they get installed.

    As I said at the beginning, I don't know for sure if this table row shifting scenario as I have described applies to your objects, but if it does, then hopefully something I've shared helps you figure out a workaround or solution.


    Kind Regards, Rich ... http://greatcirclelearning.com


    Monday, January 26, 2015 1:16 PM
  • Hi,

    Thanks for your thoughts on this!

    We have created new templates from scratch in word 2013. So, at a first glance this should not be the probelm.
    However, one thing that do cross my mind is the fact that during our development of the templates it has happened that
    we copied some table structure from the old(word 2007 template) template. This was something that crossed my mind a
    couple of weeks ago so i removed one of the tables within the template that had the content control inside of it.
    Then i created a new table and reconstructed the layout and also added the content control again to the table.
    This initially seemed to fix the problem, however, at some point(i'm guessing when performing layout changes) the
    vertical lines for the table cell with the content control in it got out of synch again. That time i did not cleanup
    the element connected to my content control within my custom xml.

    So, that last thing i tested was to do a total cleanup and i now it seems to be holding. But, i'm afraid that if i do another
    change to the layout the problem will occur again.

    One thing that i'm thinking about, could it be that some other table copied from the old template could interfere, altough
    that table does not have anything todo with the content control? Just thinking out loud.

    Br
    /Peter


    Peter

    Monday, January 26, 2015 1:50 PM
  • Hi Peter,

    After you created the new templates in Word 2013, can you reproduce the issue? If yes, please share both the templates and the CustomXml file to us, so that we can do more research on the files.

    To protect your privacy, please send the files to our email address:

    ibsofc@microsoft.com

    Regards,

    Melon Chen

    Forum Support


    Come back and mark the replies as answers if they help and unmark them if they provide no help.

    If you have any feedback on our support, please click here
    Monday, February 2, 2015 9:17 AM
  • Hi,

    I did not create new templates in word 2013 since we did that from the begining. My question was if some elements copied from earlier templates could interfere altough those elements are not directly involved?

    I have sent a sample document to the email you provided above. If you want a copy of the template it's self i will be happy to provide you with that. Just let me know.

    Br

    Peter


    Peter

    Thursday, February 5, 2015 10:37 AM
  • Hi Peter:

    Thanks for the clarificaiton. Regarding your question, I found piece of KB article and quoted some related information which pasted below. Hope it's useful for you, and if I misunderstood anything, please let me know.

    "

    • Earlier      versions of Word align text inside tables with the text outside tables. In      Word 2013, tables respect the UI settings, and the text inside tables is      not forced to align with text outside the table. By default, tables are      constrained by the margin in Word 2013.
    • Word 2013 may shift tables slightly (the default amount is .08 inch) and make tables narrower. This behavior may cause lines to break earlier. This, in turn, makes cells taller and potentially causes the page to break earlier.

    "

    For detailed information, please refer to:KB2740483.

    • Marked as answer by Chloe Wang Thursday, February 26, 2015 3:56 PM
    Tuesday, February 10, 2015 7:54 AM
  • Hi,

    I do not think this applies to this situation since it talks about making the table narrower.

    My problem is that when i insert a rich text content control inside a table cell the right vertical

    line of the one table cell seems to slightly become out of synch with the whole table.

    One other discovery that i made was the fact that this vertical line seems to be saved

    within the rich text content control due to the fact that the error shows up again when i

    transfere the saved package xml to another empty rich text content control.

    Br

    /Peter


    Peter

    Friday, February 27, 2015 2:25 PM