5 Replies Latest reply on Nov 2, 2010 4:54 AM by [Jongware]

    Convert to Header Rows

    Oviya... Level 1

      Hai Friends,

       

                               I need to "Convert to Header Rows" for table. I can do this convertion manually. But InDesignCS4 java script i cant do this. Please give                          solution for this problem. How can i do this by java script code.

      Thanks,

      Divya.

        • 1. Re: Convert to Header Rows
          [Jongware] Most Valuable Participant

          The property you are looking for is called "headerRowCount", and it's part of Table:

           

          myTable.headerRowCount = 3;

           

          It's not where you were expecting it -- in Row -- because you cannot change any row to a header, it has to be an n number counted from the top.

          • 2. Re: Convert to Header Rows
            Oviya... Level 1

            Hai Jangware,

             

                                Actully I tried this code. It was added one more row and applied Header Row. But I need apply for my first row in my table. I dont want add &                     apply process.

             

                                               myTable.headerRowCount = 1;
                                               myTable.footerRowCount = 1;

             

                                I did my code like this.

            • 3. Re: Convert to Header Rows
              [Jongware] Most Valuable Participant

              Ah -- yes, I tried and got the same thing: setting "headerRowCount" adds rows. That was unexpected ...

               

              Use this, then:

               

              myTable = app.selection[0].parent;
              if (myTable instanceof Table)
              myTable.rows[0].rowType = RowTypes.HEADER_ROW;

              This way you can only set one row at a time, starting at the top, so to set more than one use itemByRange (or something), or simply do this:

               

              myTable = app.selection[0].parent;
              if (myTable instanceof Table)
              {
              myTable.rows[0].rowType = RowTypes.HEADER_ROW;
              myTable.rows[1].rowType = RowTypes.HEADER_ROW;
              }

              • 4. Re: Convert to Header Rows
                Oviya... Level 1

                Wow........

                Thanks a Lot Jangware....

                This code is working fine.

                • 5. Re: Convert to Header Rows
                  [Jongware] Most Valuable Participant

                  You're welcome.

                   

                  Please mark the question as "Answered". (I see you've never done that, the past 10 months.)