2 Replies Latest reply on Jul 12, 2012 12:20 PM by DKomjati

    How can I unmerge table cells keeping text in each cell?

    DKomjati

      I have 100+ tables in CS4, each with 2 columns of merged cells that need to unmerge, but for some reason won't. Even if they did unmerge, I still need the text in each row to be back in it's original cell. Each number in the cell has a paragraph return after it except the bottom number.

       

      It looks like this now:

       

      Header 1Header 2Header 3Header 4Header 5

      12

      15

      100

      65

      32

      6

      9

      26

      100

      79

      This

      column

      doesn't

      change

       

      This

      column

      doesn't

      change

       

      This

      column

      doesn't

      change

      88

      55

      35

      78

      1

      56

      39

      123

      2578

      1

      This

      column

      doesn't

      change

      This

      column

      doesn't

      change

      This

      column

      doesn't

      change
















       

      The first two colums need to look like this, leaving the other columns unchanged. Can someone tell me how to do this? I would be eternally grateful.

       

      Header 1Header 2
      126
      159
      10026
      65100
      3279
      8856
      5539
      35123
      782578
      11
        • 1. Re: How can I unmerge table cells keeping text in each cell?
          Jump_Over Level 5

          Hi,

          Just to show how to make it for 1st column, 1st merged cell:

          (select some text box with one of those tables)

           

          MT = app.selection[0].tables[0];

          myContent = MT.columns[0].cells[1].contents.split("\r");     //     if cells[0] is a header

          MT.columns[0].cells[1].contents = "";

          MT.columns[0].cells[1].unmerge();

          // Assuming: number of cells merged is equal to number of paragraphs in unmerged one:

          for (k = 1; k<myContent.length; k++)                                  

              MT.columns[0].cells[k].contents = myContent[k];

           

          rgds

          • 2. Re: How can I unmerge table cells keeping text in each cell?
            DKomjati Level 1

            Thank you so much for trying to help me!

             

            I'm getting the Syntax Error "Expected expression, property or key form,

            etc. but found unknown token."

             

            I have attached a screen shot of my AppleScript Editor window. I'm

            relatively new to scripts so maybe I'm doing something wrong.

             

            I may have to leave soon but will continue working on this tomorrowŠthanks

            again!!

             

            Thank you again!