Unable to merge cells in a table

Hello Forum,

I use Indesign 5.5, problem to merge cells in a table in a script.

I want to merge multiple cells in a table.

I have three first fusion fusion coorectly, but my script not able to merge before merge.

I use,

var myDocument = app.activeDocument;

var myTextFrame = myDocument.spreads.item (0).textFrames.item ("Spread0TxtFrame0");

var table = myTextFrame.tables.firstItem ();

var t = table.rows.length;

var f = table.rows.length - (number of lines of t-start) / / * many lines of departure is intiger indicates the beginning of fusion line

var fn = table.rows.length - (number of lines of t - end)

table. Columns [1]. Cells [f]. Merge table.columns [2] .cells [fn];      * [1] = column starting, [2] = end of column

When I the value for the first three merge it works but when I use for indxing fusion returns is the change in value of rows.what that I'm passing in f and fn.

example: -.

var t = table.rows.length;

var f = table.rows.length - (t-0);

var fn = table.rows.length - (t-5);

table. Columns [0]. Cells [f]. Merge table.columns [0] .cells [fn];   It is the first merger

var t = table.rows.length;

var f = table.rows.length - (t-0);

var fn = table.rows.length - (t-0);

table. Columns [2]. Cells [f]. Merge table.columns [3] .cells [fn];   This is the second merger

var t = table.rows.length;

var f = table.rows.length - (t-1);

var fn = table.rows.length - (t-1);

table. Columns [1]. Cells [f]. Merge table.columns [2] .cells [fn];   That's the third merger

var t = table.rows.length;

var f = table.rows.length - (t-3);

var fn = table.rows.length - (t-3);

table. Columns [1]. Cells [f]. Merge table.columns [3] .cells [fn];   That's before merger

I get

an extra row merges with a following...

separately the four works to merge but when I fire script with all it merge back bad cells merged.

Please correct me where I'm wrong in the script.

your answer will be beautiful.

Thank you

Ajay

The number of lines is this table a in the first place? The most likely problem is that, because of previous mergers, the number of remaining rows is such that it is not enough lines left for f which will be formed properly.

I may be off base here because I do not see that the screen Capture you tried to send.

Dave

Tags: InDesign

Similar Questions

  • With the last update, I am unable to merge cells in a table and Ive tried Split and Live view.

    With the last update, I am unable to merge cells in a table and Ive tried Split and viewing live, all the tutorial and manuals say to do in Design view, which is no longer available.  How to merge cells in a table now?

    To get the fashion Design back in a checkerboard to fluid...

    Close all other files, open the fluid grid css and add the X below:

    /*

    Properties Grid Dreamweaver fluid

    ----------------------------------

    DW-num-CLO-mobile: X 4;

    DW-num-CLO-Tablet: 8;

    DW-num-OCOL-Office: 12;

    DW-gutter-percentage: 25;

    =====================================

    Then save and close the file.

    DW restart and you should have mode Design from here out on all files using this fluid grid .css file.

  • Dealing with the merged cells in a table

    Hello

    I use tables often enough in InDesign, and I always ran into the same problem with the scripts - dealing with merged cells

    The number of lines, I have a few cells which are merged horizontally

    As I go through the cells in my selection, I want to test the line with the contents of the first cell in the same row - that is, the key to the line

    In short, that's what I want to do:

    1. Select the cells (manually)

    2. run the script that checks each cell in the selection to test if it is in a line that begins with 'TOTAL' - and then, act accordingly

    My problem is that the results are never is correct because some lines have merged cells

    In turn, column 1 could have 50 lines, but column 2 can only have 48 rows (because it has 2 m)

    That is why, when I check the contents of the first row as such:

    cells[1].parentRow.cells[0].contents
    

    He was not a match - even if it's in the same line.

    What is the best way to get around this problem?

    If anyone can give help on this topic, I would be very appreicate it

    Thank you

    Davey

    Why do you need to know the index of line? Isn't parentRow get you the line concerned? I tried to recreate it but I don't see the problem. Maybe you can post some more of your code where exactly is the shift is not clear.

  • Merge cells in a table

    Hello

    How to merge cells in a vertical table (cells of different rows in the same column) in the designer.

    Thank you

    You can merge cells in a row, but I don't think you can merge the cells in a column. Maybe an alternative is to use another table. For example, column D is a table with a header line and a body line.

    Steve

  • Merge cells in the table (model RTF)

    Good, everyone! Is it possible to merge cells during execution of certain conditions?

    Edited by: user11367404 the 24.08.2009 06:10

    Look at this.

    http://winrichman.blogspot.com/search/label/row%20Spanning

  • [CS4] [JS] Merge cells in a table?

    Hello world!

    I make small script to apply a group of commands in the text. I select text, transformation to Table paragraph style applies styles (table and cell styles) and unfortunatelly each line in a separate cell. I need to do everything in a single cell only.

    How can I do this? Help, please.

    This is the script:

    myText = app.selection [0] .appliedParagraphStyle = "Norma DO."
    myText = app.selection [0];
    myTable = myText.convertToTable ("\t", "\r"),
    myTable.appliedTableStyle = "DOU".
    myTable.cells.itemByRange(0,-1).appliedCellStyle = "Cell DOU";
    myTable.cells.itemByRange(0,-1).clearCellStyleOverrides;
    myTable.cells.Merge;

    This last line does not work, gives an error.

    Thank you.

    Wagner

    myTable.cells.Merge is not a valid Javascript command - for various reasons.

    First of all, the Merge command is not a valid function on cells. You probably meant "merge".

    Then, the merger does not work on 'cells' - an array of cells. Instead, it runs on either a single cell (and you have to tell with what other cells to merge), or a collection of cells.

    Finally, since it is a function, it needs a pair of parentheses.

    If this does work:

    myTable.cells.itemByRange(0,-1).merge ();

    Specify a collection to merge, or, Alternatively,.

    myTable.cells.firstItem () .merge (myTable.cells.lastItem ());

    saying to merge all of the first cell to the last cell.

  • Why split cells in a table to work but merge cells is not yet highlighted in my choices

    alter - table - cell splitting works very well. I can select a line of cells and try to change merger - table - but the choice of the merger is not yet highlighted

    To modify > table > merge cells to work, many cells had to be selected. If you use Dreamweaver CC in Live View mode, a single element can be selected simultaneously. Therefore, merge cells is disabled. Merge the cells will also be disabled if you select a table row, because the cells inside the line that should be chosen, not the line itself.

    Switch to Design view to merge cells.

  • help with some merged cells in table

    I'm just learning how to use Dreamweaver 8 and tables. I am trying to use a table with merged cells, filled with graphics - one graph per cell. I make my jpg size of my cell, which seems to fill. Then, when I download to view in the browser, it seems that the graph does not entire cell. At one point, he worked in Dreamweaver and the browser. Now, in the browser view, it seems that there is more space above the image and below. Any suggestions on what is happening?

    Thank you! It is now clear that I should not use tables with the graphics.

  • Merge cells in Excel of the RTF model output

    Newbie question. When I create a RTF model whose primary production is Excel, I usually have a lot of merged cells. Any advice on how to fix that? I almost always prefer my split cells.

    exporting to XLSX

    What export to xls?

    also that there emerged word? where is the same behavior or not?

    as I said

    can not say without looking at it

    can be yes or no

    output image seems strange

    It's may be bug or incorrect model

    Look at

    Generate an Excel output with an RTF template columns and rows of a Table are combined (Doc ID 1590858.1)
  • How to split the merged cells in the current document

    Hi experts

    How to script a separation all the merged cells in the current document?

    Thank you

    Respect of

    John

    something like:
    app.activeDocument.stories.everyItem ().tables.everyItem ().cells.everyItem () .unmerge () should work (not tested)

  • Selection problem lines/cells in a table in Indesign CC

    I have a problem when you try to select rows and cells in the tables created in Indesign CC. I use a Macbook Pro with OS x 10.9.4.

    As you can see if all goes well the image attached, I'm unable to select lines and cells properly. Believe it or not, the attached image shows the last 2 rows in the selected table. As I drag the cursor to highlight the cells/rows I want to highlight section jumps around the place is not clear which section of the table is actually selected.

    If anyone has any suggestions as to what could be the cause I would appreciate your thoughts.

    Thank you

    Craig

    I think you should be on 9.1, this problem exists in this version and has been fixed in 9.2.1

    I would recommend that you upgrade to InDesign CC at least 9.2.1

    Thank you

    Javed

  • Merging cells in a line...

    Other.png

    I would like to be able to turn to the first table in the second. I see that there is a fusion of cell, but I can't understand the syntax.

    Thanks in advance for your help.

    rowCellCount is simply rows.cells.length or rows.columns.length - without intending to, I think the first gives the actual number of cells in a row (merged or not) and the second the initial number of columns.

    To merge, use http://jongware.mit.edu/idcs5js/pc_Cell.html#merge like this:

    table = app.selection[0];
    if (table.hasOwnProperty("baseline")) table = table.parent;
    if (table instanceof Cell) table = table.parent;
    if (table instanceof Column) table = table.parent;
    if (table instanceof Row) table = table.parent;
    if (table instanceof Table)
    {
              table.rows[0].cells[0].merge (table.rows[0].cells[1]);
    }
    

    .. the first 6 lines must ensure that the script knows where it is. In this way, it will work with the text within a cell cursor (each text object has a property 'basic';) "I think it's something that I learned from Dave Saunders), or with a cell, column, row or the entire table selected. After spotting the table, it's just a matter from the description of "merge cells:

    Oh, wait, now I have a table, 3 cells per line and merge the first 2 cells, to test my first assertion on. Run this

    alert (table.rows[0].cells.length);
    alert (table.rows[0].columns.length);
    alert (table.rows[1].cells.length);
    alert (table.rows[1].columns.length);
    

    alert '2', '3', '3' and '3', just as I thought.

  • [JS, ID5 SVR] select the line that contains vertically merged cells

    Hello

    I want to put the line type lines that contains vertically merged cells. Example of lines containing merged cells:




























    When a line defined as myTable.rows [1], it returns an error. How to get to the second and third rows.

    Best regards, Sjoerd

    How simple it can be:

    var myDoc = app.activeDocument;
    
    var myTables = myDoc.stories.everyItem().tables.everyItem().getElements();
    
    for (i=0;i
    

    I'm a rookie, that's for sure...

  • How can I combine the 2 vertical cells in a table 2 ranks, while retaining his other 4 columns NONmerged?

    I use Dreamweaver CS5 and wonder if there is a way to merge 2 vertical cells centralized in a table of 2 oars, while cells of his other 4 columns (2 on each side) NONmerged.   It is possible, please?   I go to:

    MODIFY-> TABLE

    but the function "MERGE CELLS" which seems it is dark, while the other options are, however, ready to be selected.   I've experimented with trying to select the two cells to merge, but that did not work or the other.   This could be a bug in the software?   Or could I do something naively?

    Happy 2012 at all :-)

    DreamWeaverBeliever wrote:

    I use Dreamweaver CS5 and wonder if there is a way to merge 2 vertical cells centralized in a table of 2 oars, while keeping other cells 4 columns (2 on each side) NONmerged.   It is possible, please?   I'll EDIT--> TABLE, but the function "MERGE CELLS" which seems it is dark, while the other options are, however, ready to be selected.   I've experimented with trying to select the two cells to merge, but that did not work or the other.   This could be a bug in the software?   Or could I do something naively?

    Happy 2012 at all :-)

    Is this possible?  Yes it is possible.  May be a bug in the software?  No, it's not a bug in the software.

    To merge cells, select the cells that contiguous with your mouse.  Click on a cell and with the left mouse button pressed, drag it to other cells that are to the right and below.

    You can now use merge cells and it should work.

    The alternative is to work in code view and change the code to look like this:

     

    I hope this helps.

  • How to change the default alignment of text in the cells in a table on the demand for numbers?

    I'm new to Mac. I own a MacBook pro MF839HN/A and currently using the 3.6.2 release NUMBERS (2577). I want to know if I can change the default alignment of text in the cell in a table of NUMBERS application? Also, when I select all the cells in a table to change their alignment, I can only change the horizontal alignment of the text and not the vertical alignment. To change the vertical alignment of the text in a cell, I have to select them individually. Help me with two questions.

    The only way I know is to create a table that is set up as you like, then save the empty document as a template customized by using the menu item "file > save as template:

Maybe you are looking for

  • The most convenient airport wireless

    Can I connect my Airport express to my N450 netgear modem/router combo? And if I can then what are the benefits to do? Or it would be useless to do so?

  • How to block numbers on iphone5s

    How can I block the phone numbers on an iphone5s?

  • new bionic wifi problem...

    Hey everybody! IM new here, I thought I'd see if I can get help... I'm having problems to make my wifi to work on my Bionic. I use a router linksys E1000 home. My wifi on the phone says I am connected and all the info is there a correct, but when I t

  • Cannot save my hardware

    I'm unable to find among my registerd products these: SMU-1073 Rev.: 5.3 serial number: 16A144D X-series SMU-6363 MIO Board: 0169DB0E PXI-4110-SMU power supply: 0167C57E If I rty if sign up I get a message that they can not be found.

  • Windows Mail: error 0x800ccc90 password

    Account: 'pop.ntlworld.com', server: 'pop.ntlworld.com', Protocol: POP3, server response: '-ERR error Protocol.', Port: 110, secure (SSL): no, Server error: 0x800CCC90, error number: 0x800CCC91