3 Replies Latest reply on Aug 7, 2012 4:00 AM by love_all

    Overlapping cellstyles.

    MrLeif Level 1

      I've asked this question before, trying again, as I've not solved this one yet..


      I'm importing XML originating from HTML with tables directly into a document.


      My script does this with the tables;

      - resizes cells to match content

      - resizes table to match document width

      - finds "best" position for each table and places it there


      So far so good


      All cells have assigned a cellstyle, or will be assigned a "default" style in the script.


      Problems with the cell formatting occurs when, for example;


      Cell with text "Example" in row 1 is styled with a border on top and bottom

      Cells in row 2, placed below "Example", is styled with border on bottom, but no border on top..


      Here's a simple example



      Cell with the text "Example" bottom border "disappears" until I manually reassign the style to the cell.


      How can I solve this without getting "too manually involved"?


      Is it a setting in the table or cellstyles I overlook here? (I'm more of a scripter than designer..)

        • 1. Re: Overlapping cellstyles.



          I think your table is not formatted with table header row options, try with applying "Example" cell as table header row then it wont change anymore even though if u r applying cell styles to next rows.



          • 2. Re: Overlapping cellstyles.
            MrLeif Level 1

            That is not the problem. The problem also occurs with adjacent table-body cells.


            I've found that the problem occurs due to the order the cellstyles are applied;

            Normally, I will apply the styles "left-right, top to bottom".


            In the above example, the style in cells with "how" and "it" overwrites the underline stroke in the cell above.

            When I reverse the order the cellstyle is applied (right to left, bottom to top, instead of left to right, top to bottom), the table above will be styled correctly, but other styles (e.g. if the style is "stroke-top") will not behave as I want..

            • 3. Re: Overlapping cellstyles.
              love_all Level 1

              Usually table cells will care about its own, but not on the other or adjacent cells, so there is no other option than re-applying the cell styles and even u can try out with the help of scripts.