5 Replies Latest reply on May 22, 2014 8:31 AM by hasvi

    empty column

    VeluVK Level 1

      Hi,

       

      I am doing financial tables, the tables having $, %, ).  I need to align all dollar signs, and % and ) should be hang align, How to fix this type of tables using script. Any script available for this?

       

       

      Regards,

      Velu

        • 1. Re: empty column
          Chinnadk Level 4

          Hi Velu,

           

          Use the below code. Note the position of the tabstop i have given below is '1p' which you can change or fix it in the paragraph style.

          var table = app.activeDocument.stories.everyItem().tables.everyItem().getElements();

          for(i=0; i<table.length; i++){

              var columns = table[i].columns;

              for(var j=0;j<columns.length;j++)

              {

                  if(columns[j].cells[0].contents.indexOf(")") > -1){

                      columns[j].cells.everyItem().texts[0].tabStops.add({position:"1p", alignment:TabStopAlignment.CHARACTER_ALIGN, alignmentCharacter:")"});

                  }

                  else if(columns[j].cells[0].contents.indexOf("%") > -1)

                  {

                      columns[j].cells.everyItem().texts[0].tabStops.add({position:"1p", alignment:TabStopAlignment.CHARACTER_ALIGN, alignmentCharacter:"%"});

                  }

                  else if(columns[j].cells[0].contents.indexOf("$") > -1)

                  {

                      columns[j].cells.everyItem().texts[0].tabStops.add({position:"1p", alignment:TabStopAlignment.CHARACTER_ALIGN, alignmentCharacter:"$"});

                  }

              }

          }

           

          Regards,

          Chinna

          • 2. Re: empty column
            VeluVK Level 1

            Hi Chinna,

             

            Please suggest the below requirement.

             

            How to fix the financial table using script, (for example see below table. i have fixed manually, my document having more than 50 tables)

             

            %, ) are hang aligned.

            $  are left aligned as like below.

             

             

            untitled.JPG

             

            Regards,

            Velu

            • 3. Re: empty column
              hasvi Level 1

              Hi velu,

               

              can you instruct me how to attach the snapshot as like you in this message box

               

              by

              hasvi

              • 4. Re: empty column
                VeluVK Level 1

                Hi hasvi,

                 

                Click the below icon and insert picture.

                 

                Picture 2.png

                 

                 

                 

                Regards,

                Velu

                • 5. Re: empty column
                  hasvi Level 1

                  Thanks velu

                   

                  Sent from Yahoo Mail on Android