2 Replies Latest reply on Nov 1, 2012 1:44 AM by AlienLai

    How to apply two paragraph Style to Table??

    AlienLai
      Header 1Header 2Header 3Header 4
      parastyle1parastyle2parastyle1parastyle2
      parastyle1parastyle2parastyle1parastyle2
      parastyle1parastyle2parastyle1parastyle2
      parastyle1parastyle2parastyle1parastyle2

       

      Hello,anyGod of the JS, i have two paragraphstyle, i want to apply to table.

      Now i can only apply style to the table. but i dot't know how to apply columns i want to chosse.

       

      pls help me      thankyou very mush^^

       

      var myDoc=app.activeDocument;

         

          var    myParagraphStyle = myDoc.paragraphStyles.item("parastyle1");

      var myTable = app.selection[0].convertToTable("\t","\r");

          myTable.rows.item(0).rowType = RowTypes.headerRow;

      myTable.columns.item(0).width = "30 mm";

      myTable.columns.item(1).width = "30 mm";

      myTable.columns.item(2).width = "30 mm";

      myTable.columns.item(0).width = "30 mm";

       

      var celltable = myDoc.cellStyleGroups.item('Cell').cellStyles.item('Table');

      myTable.cells.everyItem().appliedCellStyle = celltable;

          app.selection[0].applyParagraphStyle(myParagraphStyle, true);