Tables - height of row and cell INSET

I'm working on ascript to do the following:

1 put the first row of every table in my doc on these parameters:

  • Height of row = .25in
  • Top and bottom Inset = .04in

2. put the rest of the cells in these settings:

  • Row height = .12in
  • Top and bottom Inset = .12in

Here is where I am:

app.activeDocument.stories.everyItem (). tables.everyItem (Rows) [0] .height = ".25 in."

app.activeDocument.stories.everyItem (). tables.everyItem () .topInset of Rows [0] = '.04 in. "

app.activeDocument.stories.everyItem (). tables.everyItem () .bottomInset of Rows [0] = '.04 in. "

for (x = 1; x < app.activeDocument.stories.everyItem (). tables.everyItem (). rows.length; x ++) {}

app.activeDocument.stories.everyItem (). tables.everyItem () Rows [x] .height = ".12 in."

}

for (x = 1; x < app.activeDocument.stories.everyItem (). tables.everyItem (). rows.topInset; x ++) {}

app.activeDocument.stories.everyItem (). tables.everyItem () Rows [x] .topInset = ".12 in."

}

for (x = 1; x < app.activeDocument.stories.everyItem (). tables.everyItem (). rows.bottomInset; x ++) {}

app.activeDocument.stories.everyItem (). tables.everyItem () Rows [x] .bottomInset = ".12 in."

}

I get this error message and I'm stuck.

error-1.jpg

Anyone see anything that would be useful?

Thanks in advance.

Indeed there is a parenthesis of additional locking on this line in the screenshot (but not in your lines of the sample).

I wonder if this construction

for( x = 1; x < app.activeDocument.stories.everyItem().tables.everyItem().rows.length ; x++ ) {
app.activeDocument.stories.everyItem().tables.everyItem().rows[x].heig ht = ".12 in";
}

each could work... For... loop expects a number of end-simple but you feed it with a table of all the lengths of line of the individual tables.

If this does not work turn around your script. All the heights of line and the boxes using the value

app.activeDocument.stories.everyItem().tables.everyItem().rows.everyItem().topInset = ".12 in";

and after this, run the lines to make the adjustments of the top row.

(Use 'Advanced editor' to be able to define syntax highlighting Javascript-, it makes your code a little more readable).

Tags: InDesign

Similar Questions

  • How to create the table with the rows and columns using the layout?

    One of my friends advised me to put my site on the mode of provision as it is better than the standard as he said
    but I couldnot make an ordinary table with the rows and columns in mode available th
    y at - there someone who can tell me how to?
    Thank you very much

    Wednesday, April 18, 2007 21:01:38 + 0000 (UTC), "Mr.Ghost".
    wrote:

    > A friend of mine advised me to put my whole site on the mode of disposal as its
    > better than standard, as he says

    Your friend won't. Don't listen to him any more. Mode of disposal creates
    very fragile and rigid code pauses at the first opportunity.

    Gary

  • How can I insert a number to a specific index (row and column) to a table

    I had the most with function 'insert into array' problem because of its counter-intuitiveness. I want to insert a number I got inside a loop IN a table. The ROW and COLUMN of this table I want enter the number is specified by the number of loops of two loops FOR. It did not work.

    So, I have isolated and tested this function further. Frankly, I initialized a table 2D with ZEROS and plugged into the "insert into array" function (on top of entry). I then put the number '1' for the index (line) and the number "2" for the index (column) and then put the entry number "6" for the "new item/sub-table. Then, I hung a picture of 2-D (indicator) output to the output of the function "insert into array. When I did all that, it means I want to just put the number '6' in line '1' and the column '2'... This isn't letting me do it.

    How can I do this SIMPLE?

    Hi Darrell h...,

    Looks like you can use the function "autoindexing. Take your value and connect it to your loop, it will be a default autoindexing. Right-click on the last tunnel of output and select Create indicator, the result is your table.

    It will be useful.

    Mike

  • Obtaining of row and column of a table element

    Hello

    I have a table of 24 rows and column 24 giving me a total of 576 items. How can I get the row and column of a particular element in a table in LabView. For example if I write to item 127 How can I get the column and line item 127 is located.

    Kind regards

    Bastien

    Hi Marion,.

    Maybe just need to find the right "address" element in your 2D table?

    Use something like this:

    Maybe you have to out of line & column according to your numbering scheme...

  • AppleScript to apply styles of table and cell in IDCS4

    I have an Applescript script to format all the tables in a document as I want.  It is adapted from a previous version that did not use styles, that works perfectly.  This script creates styles if they are not present and this bit works fine, but when it starts to try to apply them to the tables, it falls.

    tell application "Adobe InDesign CS4"
         tell active document
              set BlackColor to color "Black"
              set SolidStroke to stroke style "Solid"
         end tell
         tell active document
              try
                   set myTablePara to paragraph style "4.2 Table text"
              on error
                   set myTablePara to make paragraph style with properties {name:"4.2 Table text", applied font:"Helvetica Neue", font style:"Regular", point size:"8.5", leading:"10"}
              end try
              try
                   set myBasicCell to cell style "Basic cell"
              on error
                   set myBasicCell to make cell style with properties ¬
                        ¬
                             {name:¬
                                  "Basic cell", bottom edge stroke weight:0 ¬
                                  , bottom edge stroke color:BlackColor ¬
                                  , bottom edge stroke type:SolidStroke ¬
                                  , right edge stroke weight:0 ¬
                                  , right edge stroke color:BlackColor ¬
                                  , right edge stroke type:SolidStroke ¬
                                  , top edge stroke weight:0 ¬
                                  , top edge stroke color:BlackColor ¬
                                  , top edge stroke type:SolidStroke ¬
                                  , left edge stroke weight:0 ¬
                                  , left edge stroke color:BlackColor ¬
                                  , left edge stroke type:SolidStroke ¬
                                  , left inset:¬
                                  "0p4", right inset:¬
                                  "0p4", top inset:¬
                                  "0p4", bottom inset:¬
                                  "0p4", vertical justification:top align ¬
                                  , applied paragraph style:myTablePara}
              end try
              try
                   set myHeader to cell style "Header"
              on error
                   set myHeader to make cell style with properties ¬
                        {name:¬
                             "Header", based on:myBasicCell ¬
                             , bottom edge stroke weight:¬
                             "0.5pt", top edge stroke weight:"0.75pt", vertical justification:bottom align ¬
                             }
              end try
              try
                   set myFooter to cell style "Final Row Cell"
              on error
                   set myFooter to make cell style with properties ¬
                        {name:¬
                             "Final Row Cell", based on:myBasicCell ¬
                             , bottom edge stroke weight:¬
                             "0.75pt"} ¬
                             
              end try
              try
                   set myLeftCol to cell style "First Column Cell"
              on error
                   set myLeftCol to make cell style with properties ¬
                        {name:"First Column Cell", based on:myBasicCell, left inset:0}
              end try
              try
                   set myLeftHeader to cell style "First Row, First Column Cell"
              on error
                   set myLeftHeader to make cell style with properties ¬
                        {name:"First Row, First Column Cell", based on:myHeader, left inset:0}
              end try
              try
                   set myLeftFooter to cell style "First Column Last Row Cell"
              on error
                   set myLeftFooter to make cell style with properties ¬
                        {name:"First Column Last Row Cell", based on:myFooter, left inset:0}
              end try
              
              try
                   set myTableStyle to table style "Horizon"
              on error
                   set myTableStyle to make table style with properties {name:¬
                        "Horizon", body region cell style:¬
                        myBasicCell, header region cell style:¬
                        myHeader, footer region cell style:¬
                        myFooter, left column region cell style:myLeftCol}
              end try
         end tell
         set allTables to every table of every story of active document
         repeat with i from 1 to count of allTables
              set myTable to item i of allTables
              set table style of myTable to myTableStyle
              set properties of cells of myTable to ¬
                   {cell style:myBasicCell}
              set properties of cells of first column of myTable to ¬
                   {cell style:myLeftCol}
              set properties of cells of first row of myTable to ¬
                   {cell style:myHeader}
              set properties of cells of last row of myTable to ¬
                   {cell style:myFooter}
              set properties of first cell of first row of myTable to ¬
                   {cell style:myLeftHeader}
              set properties of first cell of last row of myTable to ¬
                   {cell style:myLeftFooter}
              clear cell style overrides
              clear table style overrides
         end repeat
    end tell
    

    When it is to 'set style table of myTable to myTableStyle' it is said ' impossible to define style table id of the table to text frame id page id 220 190 of spread id 185 [the first table] document \"Untitled-1\" table style id 264 [style newly generated] document \"Untitled-1\" 224 "  But I can't tell why.  Can anyone help?

    Table and cell styles are objects. When you want to apply, you must set the appropriate properties that are 'applied the style of table"and"cell style ". So: «the game applied style table myTable...» »

    But in terms of results, you'll be probably happier using the commands ' apply the style of table cell / ' instead, which allows you to clear the replacements.

    --

    Shane Stanley [email protected]>

    AppleScript Pro Sessions http://scriptingmatters.com/aspro>

  • height of row in the tables

    Hello

    I want to adjust the height of the rows in tables, but I could not find the function or the right way to do it.

    The table is in the mode column.

    The line size mode is set to use explicit size

    First, I remove all of the rows and columns, then the following code:

    InsertTableColumns (SA_ScatPosPanel, P_MULT_ROT_Z_TABLE, 1, NbX_Points, VAL_USE_MASTER_CELL_TYPE);

    ColWidth = PlotAreaWidth / NbX_Points;

    SetTableColumnAttribute (SA_ScatPosPanel, P_MULT_ROT_Z_TABLE,-1, ATTR_COLUMN_WIDTH, ColWidth);

    InsertTableRows (SA_ScatPosPanel, P_MULT_ROT_Z_TABLE, 1, NbY_Points, VAL_USE_MASTER_CELL_TYPE);

    What should I add to also set line heights?

    Thank you

    Moreover, Bertrand, you don't have to use a loop if you do not want. You can rewrite the above code as follows:

    InsertTableRows (SA_ScatPosPanel, P_MULT_ROT_Z_TABLE, 1, NbY_Points, VAL_USE_MASTER_CELL_TYPE);

    SetTableRowAttribute (SA_ScatPosPanel, P_MULT_ROT_Z_TABLE,-1, ATTR_SIZE_MODE, VAL_USE_EXPLICIT_SIZE);

    SetTableRowAttribute (SA_ScatPosPanel, P_MULT_ROT_Z_TABLE,-1, ATTR_ROW_HEIGHT, RowHeight);

    Luis

  • Table and cell Style

    Hi all

    Greetings...

    The script below works perfectly in indesign CS3 to apply table and cell style. But in indesign CS4 shows runtime error. Kindly help me on this...

    var myTable = app.activeDocument.stories.everyItem().tables; 
    
    for (var n=0; n < myTable.length; n++)
    { 
         myTable[n].appliedTableStyle = "Table Style 1"; 
         myTable[n].cells.everyItem().appliedCellStyle = app.activeDocument.cellStyles.item("[None]");
         myTable[n].cells.everyItem().clearCellStyleOverrides (true); 
    
         alert(myTable[n].rows.length);
    
        for (var a = 1; a < myTable[n].rows.length - 2; ++a)
         {
               myTable[n].rows[a].cells.everyItem().appliedCellStyle = "T body";
               alert(a);
         }
      
        myTable[n].rows[0].cells.everyItem().appliedCellStyle = "T col hd";//First Row 
         myTable[n].rows[-1].cells.everyItem().appliedCellStyle = "T body bot";//Last Row
    
    }
    

    Thank you

    Knockaert

    Hi Karthik,

    Please try the JS Code below and come back.

    var myTable = app.activeDocument.stories.everyItem().tables;
     for (var n=0; n < myTable.length; n++){
    //~      myTable[n].appliedTableStyle = "Table Style 1";
    //~      myTable[n].cells.everyItem().appliedCellStyle = app.activeDocument.cellStyles.item("[None]");
    //~      myTable[n].cells.everyItem().clearCellStyleOverrides (true); 
    
    // Please check the table cell styles name is correct or not?
        var myActiveTable = myTable[n];
        myActiveTable.rows.itemByRange(0,-2).cells.everyItem().appliedCellStyle = "TB";
        myActiveTable.rows[0].cells.everyItem().appliedCellStyle = "TCH";//First Row
       myActiveTable.rows.itemByRange(-2,-1).cells.everyItem().appliedCellStyle = "TBB";//Last Row
        }
    

    the output of code js above looks like this snapshot.

    THX

    csm_phil

  • Tame the table and cell styles

    I find table styles and cell styles to be quite a nightmare in InDesign - in other words, as long as the paragraph style is included in the definition of the cell style. The only way I could get a table without substitution involves the steps as much as it is not effective:

    1) click an empty paragraph.

    (2) apply the paragraph style.

    (3) type the text that will come eventually in a table cell. (All my paintings are a cell, a column tables).

    (4) select the text without selecting the symbol of paragraph at the end.

    (5) choose table > convert text to table.

    I would be very happy if anyone knows of a script that can do these steps and can put me out of my misery.

    (Or maybe is there a way to avoid cell style replacements that I did not discover. (There was a discussion on this problem to http://forums.adobe.com/message/2043634#2043634, but none of the suggestions got rid of substitutions of paragraph style cell.)

    Hi jay

    You should check the character styles. If paragraph styles will not be on the trip, I found that it is because it applies a character style. Some people use styles to the paragraphs format characters. (?!)

    RB

  • Expand the table, the rows and columns

    I can make my table grow in rows or in columns, but not both, when I add a line, it will not add the column that I just added and the colum will not include the line that I just added.

    We know what script I need for the addInstance know whan I added a new row or column.

    Thank you.

    I had a look, and here's what I came with. Whenever you add a row or column, you are chnaging the expression of som that allows to add the next row or column. I added a loop around each call to add the columns/rows as needed.

    Is that what you're looking for? See the attached file

    Paul

  • Centering the table and cell borders.

    Hello, everyone:

    I am creating a tabular presentation and wish to have my main table (containing another table in some of its cells) is centered in the window of my browser so that as the viewer resizes the window web page design remains in the Middle both in horizontal and vertical plans. I found a command in Dreamweaver that allows me to Center a table on the horizontal plane, but nothing that allows me the same thing on the vertical plane. How can this be accomplished? I prefer to stay away from CSS that I'm still not familiar and sufficiently comfortable around her. I prefer to stay with a simple table layout.

    I also try to set fixed sizes for my table cells, but have not found a way to do it. I managed to create transparent GIF images to use as placeholders but (1) this seems to be too much work for something that probably can be accomplished in a much easier way and (2) the cells are not confined to the size of the GIFs and eventually larger than GIF images.

    Any suggestions will be appreciated.

    Thank you in advance,

    Joseph Chamberlain

    James:

    I thank you for your help and you have my apologies for this late reply.

    I looked at the link you provided and it has the answer to my question. Thank you once again. I wish just that there is a simpler and intuitive to do.

    Best regards

    Joseph Chamberlain

  • Table and cell borders

    I use CS4. I created a table style in my stylesheet that calls for an orange 2 px wide border. The border only described the entire table, but not individual cells. Anyone know how I can fix this in the stylesheet?
    The URL is http://www.virginiacpac.org/pages/conference.html
    Thank you

    Hello

    Try this:

    {.table_border}
    border-collapse: collapse;
    }
    .table_border td {}
    border: 2px solid #E2832F;
    padding: 2px;
    }

    Take care
    Tim

    "dlipscombe" wrote in message
    News:giekco$BQJ$1@forums. Macromedia.com...
    > I'm using CS4. I set up a table style in my stylesheet that calls for a 2
    > px
    > orange wide border. The border only outlines the entire table but not the
    > individual cells. Anyone know how I can fix this in the stylesheet?
    > The URL is http://www.virginiacpac.org/pages/conference.html
    > Thank you,
    >
    > .table_border {}
    > border: 2px solid #E2832F;
    > padding: 2px;
    > }
    >

  • Height of the disconcerting cells

    Hello
    Forgive my ignorance. For the life of me I can't understand why this cell of a row in the Table height seems to be out of control. "If you go to my site please look at the white line with ' Rushton farm ' and the text to the right. I want the rank at the same height as the image of the logo close Rushton, which is 157.

    http://www.wctrust.org/communityfarm/farm.html

    Thanks much for any help!

    Wait you will look at the page in anything other than IE! It's a real treat in
    Firefox.

    Your problem is related to the use of table cell splits and mergers to build
    This monolithic table. Please read this-

    http://apptools.com/rants/spans.php

    Changes in the form of a split/merged cell affect ALL cells of the
    table when you do this and it affects them in ways that you don't expect.

    --
    Murray - ICQ 71997575
    Adobe Community Expert
    (If you * MUST * write me, don't don't LAUGH when you do!)
    ==================
    http://www.projectseven.com/go - DW FAQs, tutorials & resources
    http://www.dwfaq.com - DW FAQs, tutorials & resources
    ==================

    "spraggini" wrote in message
    News:fqhaps$76C$1@forums. Macromedia.com...
    > Hi there,
    > Forgive my ignorance. I can't for the life of understand me why this
    > Cell of table row height seems to be out of control. If you go to my site
    > please
    "> Watch the white line with ' Rushton farm ' and the text to the right. I have
    > want to
    > This line at the same height as the image of the logo close Rushton, who is
    > 157.
    >
    > http://www.wctrust.org/communityfarm/farm.html
    >
    > Thank you very much for any help!
    >

  • Extraction of text from the strings in a single cell of a row of cells

    Hello

    Is there an easier way to search a text / word of a string in the row of cells, and where a match is found back a header text - see the example below.

    The left table contains the initial positions of conformity in groups of companies. I would like to complete the table on the right with compliance positions indicated in the table on the left, using the header text (red zone). Example 1 shows that "C company" is not in line with the left table and returns a "Non-compliant" in the relevant cell for company C. Example 2 A company, C and Z are in line with the left table and returns "comply" in the relevant cell in company A, C and Z respectively. It goes the same for the partial.

    The lines must also be aligned as shown in the left column will contain a single reference (not shown in the example).

    My current approach was to simply build a small matrix and use IF (COUNTIF ($E5, "* company A *" "'), 'In line'," "") - this works fine, but is a bit messy - obtained above table, it's really what I like o would reach.

    I also tried to use nested 'FI', 'find', 'Index' and 'Match' combinations, based on a few positions at the beginning, but not could not get the correct syntax.

    Would appreciate other solutions for the construction of the table to the right.

    Thank you in advance...

    Pasel

    This may work for you:

    A2 = if (COUNTA ('Table 1 - company compliance Positions': $A2) > 0, IF (LEN ('Table 1 - company compliance Positions': $A2) −LEN (SUBSTITUTE ('Table 1 - company compliance Positions': $A2, A$ 1, "")) > 0, 'table 1 - company compliance Positions': $A$ 1, ' '), "") & IF (COUNTA ('Table 1 - company compliance Positions': $B2) > 0, IF (LEN ('Table 1 - company compliance Positions': $B2) −LEN (SUBSTITUTE ("table 1 - company compliance Positions")) ((((: $B2, a$ 1, ' ')) > 0, "table 1 - company compliance Positions": $B$ 1, ' '), "") & IF (COUNTA ('Table 1 - company compliance Positions': $C2) > 0, IF (LEN ('Table 1 - company compliance Positions': $C2) −LEN (SUBSTITUTE ('Table 1 - company compliance Positions': $C2, A$ 1, "")) > 0, "table 1 - company compliance Positions": $C$ 1, ""), "")

    It's shorthand dethrone select cell A2, and then type (or copy and paste it here) the formula:

    = IF (COUNTA ('Table 1 - company compliance Positions': $A2) > 0, IF (LEN ('Table 1 - company compliance Positions': $A2) −LEN (SUBSTITUTE ('Table 1 - company compliance Positions': $A2, A$ 1, "")) > 0, 'table 1 - company compliance Positions': $A$ 1, ' '), "") & IF (COUNTA ('Table 1 - company compliance Positions': $B2) > 0, IF (LEN ('Table 1 - company compliance Positions': $B2) −LEN (SUBSTITUTE ("table 1 - company compliance Positions")) ((((: $B2, a$ 1, ' ')) > 0, "table 1 - company compliance Positions": $B$ 1, ' '), "") & IF (COUNTA ('Table 1 - company compliance Positions': $C2) > 0, IF (LEN ('Table 1 - company compliance Positions': $C2) −LEN (SUBSTITUTE ('Table 1 - company compliance Positions': $C2, A$ 1, "")) > 0, "table 1 - company compliance Positions": $C$ 1, ""), "")

    Select cell A2, copy

    Select cells A2 at the end of column F, dough

  • Table with fixed header and the left column

    I created a table in my application with the fixed left column (left most column is fixed and remaining columns are scrolling from left to right). is it possible to create a table with fixed position and fixed left column?

    Suppose there are 50 rows and 10 columns in my paintings, and only 3 columns and 15 rows are visiable on the screen

    (1) when the user scroll left to right left only most of the columns must be fixed. Remaining cap of the table and column scroll left to right and vice versa. also

    (2) when user scroll high high bottems single topic most must be fixed and remaining all lines (with to the left most column) should be scrollable.

    I am able to put in place a point at the top, but not both. Please suggest

    "If I repopulate the value in the cell when user scrolling, shell, I get scrolling effect correctly as it only shows half cell when the user highlight half of the cell."

    Approach using TablelayoutManager display single cells and scrolling would be cell at a time.  And Yes, you will need to override navigationMovement and n of methods appropriate TouchEvent your TableLayoutManager so that he knows when to fill the cells.

    Another alternative is to have four managers, we don't the the upper left corner (the dead angle), one to make the top row (column headings), one to make the left column (row headings), and the other to do the rest (data).  Place all these in a delicate header and line manager.  Only allow the user to scroll the data part.  Have the difficult Manager to listen the scroll events.  Then have the wily Manager add and remove the dummy column and header line managers as appropriate.  Note that these topic fields would not good passes, they would be either there or they would not be displayed. That would give you your 1/2 a scroll of the cell.  And you wouldn't have to substitute anything to detect movement, you would have left the listener do scrolling for you.

  • Fixed table height

    Hello

    I create a model where I need a size of fixed table height.
    For example: I need a table with 10 rows. If I have enough data to fill in these lines, they should be printed virgins.

    I saw in other threads that there is a way to limit the no. lines using <? for each: TAGNAME [position () < 10]? > in the first and the last field in the table. However, I have a different situation. In the same table, I have 2 different repeating groups - used in the 1st row and 2nd in the next line. So, I won't be able to use this function before the 1st row and end after the 2nd. If I use it only on a single group, I can't limit the total no. 10 lines. How can I accomplish this?

    Also, when I used this position() on the first line for testing, data came out white. Help, please.

    Thank you!

    Make sure your Inbox sent the sample to fill line up to 10.

    used below logic

    .... in a row in your table - need get the number of front-line and save it in a variable

    next to your table row

    <10?>............. -this complete lines if the number above is<>

Maybe you are looking for