0 Replies Latest reply on Feb 14, 2012 1:30 AM by thedesmodus

    Keep table together?


      I have found this script here, and it does the trick.

      The only thing is that I need to select each table that I can apply it to.


      Is there a way that it would work on all tables in my document.


      What it does is make sure that all rows in a table are kept together, so a table can not automatically be split over 2 pages.


      if (app.documents.length > 0 && app.selection.length == 1 && (app.selection[0].parent instanceof Cell || app.selection[0] instanceof Column || app.selection[0] instanceof Cell || app.selection[0] instanceof Row || app.selection[0] instanceof Table))
           table = app.selection[0];
           if (!(table instanceof Table))
                table = table.parent;
           if (!(table instanceof Table))
                table = table.parent;
           for (row=0; row<table.rows.length; row+=1)
                table.rows[row].keepWithNextRow = true;
      } else
           alert ("Out of Cheese Error! Re-do from start");