1 Reply Latest reply on Nov 13, 2014 11:14 PM by hurix@123

    column heads

    VeluVK Level 1

      Hi,

       

      I need  the below requirement:

       

      In all tables, some times there are more than one 'column heading' occurs. I need all Column heads should be a separate cell style.

       

      I have put one empty row, once the column heads ending. (ex: first empty row is the identifier for column heads)

       

      Script need for all the tables in a document.

       

      1) Before the 'first empty row' cells should be a "TCH" cell Style.

      2) Remaining row cells should be "Tbody" cell Style (except last row)

      3) Table last row should be a "Tbody_last"

      4) Based on the number of column heads table styles need to apply.

           if only one column head in a table, it should be "Table style 1" table style

           Two column heads in a table, it should be"Table style 2" table style

           Three column heads in a table, it should be "Table style 3" table style,  etc...

       

      table.jpg

       

       

      Regards,

      Velu

        • 1. Re: column heads
          hurix@123 Level 1

          Velu

           

          try this:

          myTable = app.activeDocument.stories.everyItem().tables;

          For look..... n=0;

           

          myActiveTable = myTable[n];

          myActiveTable.rows.itemByRange(0, -2).cells.everyItem().appliedCellStyle = "Tbody"

          myActiveTable.rows[0].cells.everyItem().appliedCellStyle = "TCH"

          myActiveTable.rows.itemByRange(-2, -1).cells.everyItem().appliedCellStyle = "Tbody_last"

           

          Ram