Merging cells in a row...

I'd like to be able to turn the first table into the second. I see that there is a cell merge, but I can't seem to figure out the syntax.
Thanks in advance for your help.

rowCellCount is simply either rows.cells.length or rows.columns.length -- without trying, I think the first gives the actual count of cells in a row (merged or not), and the second the original 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 are to make sure the script knows where it is. This way, it will work with the text cursor inside a cell (every text object has a "baseline" property; I think it's a trick I learned from Dave Saunders), or with a cell, column, row, or the entire table selected. After locating the table, it's just a matter of following the description of "Cells: Merge".
Oh wait, now I have a table, 3 cells per row and the first 2 cells merged, to test my first assertion on. Running 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);
alerts "2", "3", "3" and "3", just as I thought.

Similar Messages

  • Merge cells between 2 rows in a smart form(template)

    Hi ,
    I need to merge two cells between 2 rows of a template.
    Like the first cell is a big one 10cm height and has two adjacent 5cm cells beside it.
    Can anyone tell me if this is possible.And if Yes ,How?
    Merging cells between columns work,but i am not able to do it betweeen two rows.
    I had some Options that i treid and ruled out are
    Since it is flowing data i cant use multiple windows and so the template needs to be in my mainwindow.
    I cant use multiple main windows also .
    This merging doesnt work in table also.
    Regrads,
    Sai.

    Well I dont know if i am not clear in my question.
    Let me articulate.
    It not the conditional display of rows taht i want to acheive.
    Its  merging cells between two rows.
    Like say first a cell of height 10 cm shoudl filled with text (say 'AB')spanning full 10 cm.
    And then adjacent to this 10cm cell , there shoud be two cells of say 5cm one below each other
    with say 'A' on the top cell and 'B' on the bottom cell.
    So you have one big 'AB' (10cm cell) and then beside this you have ' A' and 'B' one below each other.
    Like shown below the Bold 'AB' spans 10 cm from top to bottom ,beside this AB is A in the top 5cm cell and
    B in the bottom 5 cm cell.
    ABA
            B
    Regards,
    Sai.

  • Merging cells for each row possible?

    Hi,
    I'm trying to merge two columns together (First name and Surname) so that the values are together i.e.
    A1 with A2
    B1 with B2 etc.
    Is there a way to do it all in one go so I don't need to go through each row manually? There are around 4000 entries, so I hope so!
    Thanks for any help,
    osu

    osu,
    You can do this by writing an expression in a third column. So, A & B will be joined in, for instance, C.
    This can be done either with the concatenation operator, "&", or with the CONCATENATE function.
    Writing =A&B will do it literally as you have requested. Most people would want a space between the two. You can do that with: =A&" "&B.
    After writing that in C1, click back on C1 and Edit > Copy. Then click on the "C" label above C1 to select the entire column. Now Edit > Paste to fill the rest of column with your expression.
    Be prepared to wait awhile for it to calculate because 3000 rows is a large file for Numbers. A "spinning ball of hard work" may be present for some time before you see the results.
    Let us know how that goes for you.
    Jerry

  • Merging cells and using the fill handle to copy the merge in subsequent...

    My problem can be best illustrated by me by explaining how I could achieve it in Excel.
    In Excel, this is how it would be done for example:
    I select two horizontal cells and click on the merge button to merge them. They are now one cell, with the fill handle (small circle) on the bottom right corner. Clicking on that circle and dragging it down will merge both cells in each row into a single cell. i.e. each subsequent row will look like the row above until I stop dragging.
    How can I do this in Numbers. Obviously I don't want both columns to become one wider column, but just a certain selection of rows within the two columns.

    doktor_florian wrote:
    Either this answer does not have anything to do with the original question or I just don't get the link.
    If I select 20 rows with two columns and press "merge" I get one cell with the content of 20 rows. This is utterly useless.
    Hi,
    1.) I think you do not entirely understand my poing. Unfortunately, I cannot upload images of what I am trying to illustrate in words.
    I am not trying to merge 2 columns and their 20 rows into one cell. What I want to do is to merge two cells horizontally.
    Open Numbers and open a blank spread sheet. You have numerous columns and rows, but for simplicity, concentrate on columns A and B and rows 1-5.
    The illustrations below show what it is I want to achieve. You start of with (1), two columns with 5 rows making a total of 10 cells. For what ever reasons, I need to merge the 2nd row (A2+B2) into a single cell. I select them, click on merge and that's it. [Illustration (2)] However, I also need the 2nd and 3rd row merged. In Excel. I would click on the bottom-right corner of the 2nd row which was recently merged and drag down. This would copy the merged cell onto the rows below and the result is shown in illustration (3). Now, I could just repeat the procedure that I did the first time I merged the two cells in row 2, but imagine if you need to do this for 10 or 20 rows. That's extremely time consuming and certainly there must be an easier way.
    (1) (2) (3)
    A B A B A B
    1 l___l___l 1 l___l___l 1 l___l___l
    2 l___l___l 2 l_______l 2 l_______l
    3 l___l___l 3 l___l___l 3 l_______l
    4 l___l___l 4 l___l___l 4 l_______l
    5 l___l___l 5 l___l___l 5 l___l___l
    2.) +"If I select 20 rows with two columns and press "merge" I get one cell with the content of 20 rows. This is utterly useless."+
    I think this is a very patronizing comment. How can you know what needs I or other Numbers users have? Perhaps it is very useless to you, in which case you should have said so, but it is not objectively useless.
    P.S. I apology for the messiness of the illustrations. It's the best I can do.

  • Table cells - Problem with merged cells

    Hi
    I was experiencing very weird behavior with my tables until I realized that it was caused by merged cells
    My script gives a dialog which allows the user to choose from which column to start and from which row.
    As the script iterates through the cells in the selection I was getting weird results
    Through using .select() function I was able to see that depending on the column, some times row 5 could be which seems to be row 3!
    The reason was because of merged cells in that row
    I.e., when some cells are merged together, only the first column of those merged cells is recognized - the others are not
    so it comes out that when merging cells from column 3 to 5, column 3 has a cell in that row, columns 4 and 5 do not, and column 6 does!
    Is there a way to get around this behavior?
    Thanks
    Davey

    I don't understand the point of your post.
    If you're trying to report a problem or "bug" with Pages, that is not the purpose of this user-to-user forum. You should leave feedback for the Pages team on this page.
    I've not had a problem opening Word files with tables in Pages. If you're saying Word can't handle tables with merged cells, then don't use merged cells in files you are going to export as Word. Word & Pages must handle merged table cells differently, as I know both can do that. As far as RTF, Pages can open & export as RTF. Again, if you are going to export as RTF, don't use tables. Neither of these is a fault of Pages, just limitations of the formats/programs.

  • In Web Dynpro ABAP, Can we merge two cells of a row in a table ?

    In Web Dynpro ABAP, Can we merge two cells of a row in a table ?

    Hallo Jagannatha,
    the new table feature is available in SAP NetWeaver 7.0 EhP2 (SAP ERP 6.0 EhP5, SAP Business Suite 7i2010) named 'TableMultiEditorCell'. See [SAP Online Help|http://help.sap.com/saphelp_nw70ehp2/helpdata/en/9b/46bb0d339b42cc8d30636ca0c9f5b6/frameset.htm] for more details ...
    "This UI element is a table cell variant that enables several UI elements to be placed in one table cell. This type of cell can be used for "one click actions". ...
    Regards, Bertram

  • How to hide rows with merged cells?

    I would like to know how to hide rows on numbers with merged cells, could do it normally at excel but I am not being able to do it at Numbers.
    thanks!

    Felipe,
    To hide a row with Merged Cells, Un-Merge first, then Hide. Select the Merged Cells and Table > Unmerge.
    Note that this is only a problem with vertically merged cells when you want to Hide a Row.
    If you want to Hide a Column, you can't have a Horizontal Merge that involves that Column.
    Jerry

  • How can I hide columns that has rows with merged cells?

    I'm making a schedule on Numbers and there are couple of rows that are one cell (merged).
    Because of this reason when I select a column to hide, it's not just the column that is being selected but the column and the all the merged cells that goes across the row. I would like to hide selected column to print different columns. Please help me! thank you!

    There is even more powerful tip.
    Double click in a cell
    Show Rulers
    Insert a "center tab"
    move it to the right edge of the cell
    type option + tab then your wanted string.
    You will get that :
    Add this tip to the drawbacks of merged cells and you will understand why I never used them.
    Yes, it may be surprising but the right tab belongs to the cell D2 !
    Yvan KOENIG (VALLAURIS, France) mercredi 8 juin 2011 16:25:25
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.7
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How to merge two cells in a row

    hi freinds,
    how to merge two cells in alv grid using oops.
    for eg ,in the first row there is text premraj
             n in the second row there is cheguri
              my requriment is two merge the two cells ie to remove the horizontal line between them
    thanks & regards,
    premraj

    Well, as a new member you should learn to search the forum first before posting questions. Using keywords like "jtable merge cell" will find other postings on this topic. Some with solutions some without, so you will need to read a few and decide on the approach you want to take.

  • Excel export are merging cells for data on multiple lines !

    Hello,
    I'm using Crystal Report XI R2, when we are doing an export to Excel with have an unexpected formatting.
    For example the value of the name is on 2 lines:
    => So, on Excel the result is on 2 lines but merged. We want to have this result only on one cells.
    Remark: if we delete the 2nd lines, because cells are merged we obtain the expected result.
    Proposal A:
    Are they any set-up available concerning the formatting of Excel ?
    Proposal B:
    Could we run some VBA when we click on Export button to make queries on the Excel ?

    When they introduced Unicode support in Crystal 9 (I believe), they had to completely re-write the export routines. At that time, they made a decision to change the functionality of the excel export. Crystal is attempting to remain absolutely faithful to the graphical layout of the report as you see it in the viewer. So it creates merged cell sections, empty columns between columns, and empty rows to give you as close to exactly what you see in the viewer as possible. Unfortunately, the result is typically less than useful. Iu2019ve had several conversations with Business Objects (now SAP) with regards to this when they changed it between versions 8.5 and 10, and they have no intention of changing the functionality as it now exists.
    There is a document which is now likely somewhere on the SAP portal that explains what you need to do to obtain the best results when exporting to excel.
    The jist of it is this:
    Line up all of the columns detail data with thier headers, and make sure that data fields are the same size as thier headers. 
    Line up all rows (headers and detail rows). (ie: select everything in the row, right click, align tops, and make the same height)
    cram everything as close together as possible. zero space in the report translates to zero extra collumns and rows in the export.
    the other option is to use the export to data only functionality, but that may not be what you're looking for either.

  • Takes a Long time to merge cells

    Why does it take me forever to merge 4 cells in a table that
    has over 100 rows. Is there anything that I can do to speed up the
    process?

    Never merge cells? I rarely do this (of course I rarely use
    tables, too) -
    instead, I will stack tables vertically when I need a new
    cell
    configuration.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "PamVa" <[email protected]> wrote in message
    news:f30u4t$o7u$[email protected]..
    > Why does it take me forever to merge 4 cells in a table
    that has over 100
    > rows. Is there anything that I can do to speed up the
    process?

  • Is there a way of merging cells (not columns) in a Flex Datagrid?

    Hello everyone!
    I'm new to Flex and I have been searching for a solution to this problem for two days now, so any help would be really appreciated!
    I have a datagrid of, lets say x columns of fixed size, with the ability to add or remove rows dynamically. When adding a row o popup comes up and lets the user determine the positions(order) and widths of the desired cells of the row. So what I want to do is to be able to merge cells of the new Datagrid row appropriately, to satisfy the user's choices. Thats the general idea.
    Is there a way to have a Datagrid (or other similar component) with different cell number and widths for each row in Flex? I need a component similar to the Datagrid because I want to be able to select rows and process their data.
    Any idea would be very helpful as I'm pressed for time and I could use someone's experience to search in the right direction and not loose time.
    Thanks in advance!

    Thank you very much for your response. I finally did what I wanted without using a Datagrid. I used a Table Flex Component (which extends Flex Grid) that I found here:
    http://code.google.com/p/flex-table/#Demo
    I downloaded the source and changed some things to make it work as I need.

  • Unable to merge cells in Table(WAD)

    HI Gurus,
    I am working on BI7.0,
    I am trying to create Web Templates to display reports in portal for that
    I have selected Table (rows and coloms), When I try to merge first two cells
    (to write descritpion of query) it is not allowing me to merge.
    Can anybody suggest me how to merge two cells in table.
    Thanks in advance.
    Maruthi
    Edited by: maruthi k on Dec 15, 2008 2:04 PM

    If you're talking simply about merging the cells in an HTML table, then you use the COLSPAN or ROWSPAN options in  HTML.
    Check out the following
    <html>
    <body>
        <table border="1" cellpadding="2" cellspacing="0">
            <tr>
                <td>
                    Heading 1</td>
                <td>
                    Heading 2</td>
                <td>
                    Heading 3</td>
            </tr>
            <tr>
                <td colspan="2">
                    Text covering 2 cells</td>
                <td>
                    Last cell</td>
            </tr>
            <tr>
                <td rowspan="2">
                    Text covering 2 cells across 2 rows</td>
                <td>
                    Text in cell 2 row 2</td>
                <td>
                    Text in cell 3 row 2</td>
            </tr>
            <tr>
                <td>
                    Text in cell 2 row 3</td>
                <td>
                    Text in cell 3 row 3</td>
            </tr>
        </table>
    </body>
    </html>
    Take the above code and put it in a simple HTML file and run that file in your browser, you should then be able to see how COLSPAN and ROWSPAN work.
    COLSPAN=2 means that the cell spans 2 columns. Similary, COLSPAN=3 would then span 3 columns.
    Remember though that when you set COLSPAN=2, you will need 1 less TD in that row, otherwise you end up with an extra cell in that row which makes your table look all messy.
    Now, in your template, get into the XHTML view, find the table, and set the COLSPAN / ROWSPAN accordingly.
    Hope this helps.
    Cheers,
    Andrew

  • I need to convert PDF to Excel, however, columns and tabs make many merged cells and many blank columns. In addition to not separate the columns correctly, I see many not separate lines together in the same cell. I'm even thinking that Adobe Acrobat Pro D

    I need to convert PDF to Excel, however, columns and tabs make many merged cells and many blank columns. In addition to not separate the columns correctly, I see many not separate lines together in the same cell. I'm even thinking that Adobe Acrobat Pro DC has limitations. There is no way to define what points in columns to force break column? Nor create many columns that are useless? How does text to column in Excel, fixed size when we import text, and define where the breaks have columns?
    Google Tradutor para empresas:Google Toolkit de tradução para appsTradutor de sitesGlobal Market Finder
    Desativar tradução instantâneaSobre o Google TradutorCelularComunidadePrivacidade e TermosAjudaEnviar feedback

    PDF does not contain columns, rows, formats, styles, or other aspects of word processing or spreadsheet file formats.
    This is because PDF is decidedly not a word processing or spreadsheet file format or something "like" one of those.
    (see ISO 32000 for what PDF "is")
    What can optimize the export of PDF page content is to start with a well-formed tagged PDF (ISO 14289-1, PDF/UA-1 compliant).
    Without that export is what it is and one performs whatever content cleanup is needed using the native application for the export file (MS Word or Excel).
    Be well...

  • [CS2/CS3 JS] Merged Cell Problem...

    Hi,
    Below is a part of my script that has been giving me a problem with merged cells:
    if (myTable.cells.item(h).bottomEdgeStrokeWeight > 0.5) {
    myTable.cells.item(h).bottomEdgeStrokeWeight = 2;
    myTable.cells.item(h).bottomEdgeStrokeType = "Thick - Thick";}
    Everytime the script passes on a merged cell, it quits and it only do changes on the first cell of the merged cells. Once I run my script again, it quits with error because the first cell of the merged cells now has a different stroke weight than the rest of the merged cells.
    Is there a way to apply stroke on merged cells? And what is the parameter for UNMERGE? Thanks.

    Hi Joaquin,
    Here are a few examples – hope it helps.
    Kasyan
    // lets assume myTable has 4 rows and 4 columns
    myTable = app.activeDocument.stories[0].tables[0];
    myStartCell = myTable.cells.item("0:0"); // cell in the 1st column and 1st row
    myEndCell = myTable.cells.item("0:3");  // cell in the 1st column and 4th row
    myStartCell.merge(myEndCell);
    // now merged cells have become the cell in the 1st column and 1st row
    myMergedCell = myTable.cells.item("0:0");
    myMergedCell.unmerge();
    // merge/unmerge the last row
    myTable.cells.item("0:3").merge(myTable.rows.item(-1));
    myTable.cells.item("0:3").unmerge();
    // merge/unmerge the last column
    myTable.columns.item(-1).cells.item(0).merge(myTable.columns.item(-1).cells.item(-1));
    myTable.columns.item(-1).cells.item(0).unmerge();

Maybe you are looking for