Change column width in multiple tables

Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Change column width in multiple tables

Viewing 2 reply threads
  • Author
    Posts
    • #100817

      I have a few hundred tables in an Indesign document where I need the first column to be 8p6 wide and the 2nd column to be 35p. Each table has a header row the width of the full column, so the columns actually start on the 2nd row. Does anyone have a script for that? Help!

    • #100822

      It’s okay, I found something. But your document preferences has to have the units set to “points”.

      // Number of columns in a table may vary depends on the book.
      // If the columns count is constant then you can use the below script.
      var myDoc = app.activeDocument;
      var myWidths = [102, 420];
      for(var T=0; T < myDoc.textFrames.length; T++){
      for(var i=0; i < myDoc.textFrames[T].tables.length; i++){
      for(var j=0; j < myWidths.length; j++){
      myDoc.textFrames[T].tables[i].columns[j].width = myWidths[j];
      }
      }
      }

    • #100854
      David Blatner
      Keymaster
Viewing 2 reply threads
  • You must be logged in to reply to this topic.
>