November 6 2007 • 1:57 PM

Moving A Table Row to a New Position

DM wrote:

How do you move a row in a table to a different location? For example, move the 4th row to the 7th position. Drag and drop doesn’t work. A copy and paste creates a table-inside-a-cell effect.

You’ve discovered one of the weaknesses in InDesign’s tables feature. There is no “move row” feature. (There is, however, a “go to row” feature under the Table menu that most people don’t notice. It allows you go jump to the 4th row, or the 405th row, quickly. Perhaps it’ll be an obscure feature of the week-eek-eek sometime in a future podcast.)

Anyway, moving one row to another ends up being a bit of a hassle. The best method is copy and paste, but as you noticed, copy and paste will sometimes give you an undesired effect. The trick is in how you paste.

First, select the row you want to move:

moverow1

Next, cut it to the clipboard (Command/Ctrl-X). You’ll notice that the whole row disappears. (I wish there were a way to make it work like Excel — take the data and leave the cells.)

moverow2

Now insert a new row where you want it (place the cursor in the row above or below the position you want to put the new row and then choose Table > Insert > Row). What you were doing is placing the flashing cursor inside a cell and pasting. That gives you a table inside the cell. Instead, select the whole cell itself (press Esc to toggle between selecting a cell or the text inside it), or select the whole row:

moverow3

Finally (and this is the hard part), choose Edit > Paste. That should do it.

moverow4

There are, I suppose, other ways to do this. For example, if it’s a simple table (no merged cells), you could convert it to text (Table > Convert Table to Text), move the data around, and then select it all and then convert it back into a table. But that, too, is fraught with peril in other ways.

Should it be this difficult? No! But as my grandmother is fond of saying, “nothing really important is ever easy.”

(Hm… perhaps my grandmother wasn’t referring to software… I’d better rethink that. :) )

14 Responses discussing this post. Add yours below.

  1. November 6th, 2007 • 2:34 pm • Link

    Not to slight your grandmother’s wise remark, but two hundred years before her Benedict Spinoza said: “All things excellent are as difficult as they are rare”.

    :-)

  2. Wa Veghel
    November 6th, 2007 • 2:45 pm • Link

    The great thing about this that this also allows to copy/paste data in a table! There was a script that populated a table with copied data (tab/return seperated) but this technique makes this script obsolete!

  3. November 6th, 2007 • 2:48 pm • Link

    Excellent post, I hear this question a lot. I’m always compelled to try to drag and drop table selections because Word lets you do it; and InDesign tables “feel” like Word tables in many ways.

    One new feature in CS3 tables that users might find useful is that you can paste tab-delimited text into a selected row and InDesign does the “tab to cell” conversion on the fly. (In CS2, Paste was greyed out when you had a target row selected; so all you could do was click inside a cell and paste all the tabbed text inside that one cell.)

    If the tabbed text you’re pasting in needs more columns than the table has, ID adds more columns to the right of the table to accomodate it.

    Also, pasting in multiple paragraphs of tabbed text will result in multiple table rows; even if only one row of the table was selected before pasting. Don’t do this in the middle of a table because ID won’t add rows there; it’ll replace existing row data with what you’re pasting in.

    But if you add a single empty row to the end of a table, select it and paste in multiple paragraphs of selected text, ID does add as many table rows as necessary to accomodate.

  4. David Blatner
    November 6th, 2007 • 3:45 pm • Link

    Klaus, well who do you think Baruch Spinoza heard that lesson from? That’s right…

  5. Michael Trout
    November 6th, 2007 • 5:26 pm • Link

    If you have Dave Saunder’s PopTabFromClip script and access to Excel (or other spreadsheets I would surmise although I’ve not tested it), you could also copy the content of the table and paste to Excel.

    Reorder the cells in Excel as desired.

    Copy from Excel and run the script to populate the table with the new order.

    Fails horribly if there are merged cells in the table, though.

    Wa, that script is still HIGHLY useful for those of us that have tables upon tables of data (rates for insurance for example) that have to be reliably pasted into an InDesign table without messing up the formatting. I do not know if CS3 and Table styles makes this less critical as I am still in the world of CS2. I use Dave’s old Apple script from InDesign 2 days (still works quite well aside from the merged cell note above).

    For a simple group of rows (or columns) I use a method basically the same as David has outlined. Although I usually wait to delete the old row until after I’ve pasted the new row data.

    -mt

  6. November 6th, 2007 • 5:36 pm • Link

    FYI: CS3 includes the copy in Excel, Paste into an InDesign table features like Dave Saunders (excellent) script offered. It’s great that this ability is now built into CS3. Just make sure to highlight at least the top left cell before pasting.

  7. November 6th, 2007 • 7:12 pm • Link

    It’s not table styles that obsoletes PopTab in CS3. It’s the ability to paste the clipboard into a table just like PopTab makes possible in CS and CS2.

    Dave

  8. emmanuel schaffner
    November 6th, 2007 • 7:33 pm • Link

    If you select a group of cells instead of a row (or column), you can cut (or copy) the data and leave the cells intact.
    The trick is to select all the row (or column) but one cell.

  9. Suhaib Ali
    November 6th, 2007 • 9:09 pm • Link

    ok. i m satisfy with u that help to me to move the row by cut and paste.

  10. Wa Veghel
    November 7th, 2007 • 12:04 pm • Link

    Yes, it is a CS3 only feature that lets you copy/paste Excel data to InDesign tables, but we were talking about only CS3. In CS2 the script is very useful, in CS3 you simply do not need it any more.

  11. April 10th, 2008 • 4:11 pm • Link

    This is what I was looking for …. except I am going to able this to columns.

  12. May 2nd, 2008 • 8:50 am • Link

    Hello,

    I have had a strange problem with Indesign tables. I have a 2 column text frame on an A6 page. I insert a table in the left side column. The table works fine as long as the content in the cell can fit within that column. However if the content of a single cell runs beyond the column height, all the text seems to disappear. Can anyone let me know if there is a fix for this?

  13. David Blatner
    May 2nd, 2008 • 2:50 pm • Link

    Dural, no there is really no fix (if I understand the problem correctly). InDesign cannot break tables across two columns; each cell must be able to fit in the table. If the row should be able to fit, then perhaps there is some other problem, such as a Keep With Next Row setting (in the Rows and Columns tab of the Cell Options dialog box).

  14. June 6th, 2009 • 3:25 am • Link

    Another weird thing, or let’s say a lack of function:
    If you copy a complete row into the clipboard, you don’t have a chance to choose whether you’d like to paste either the cells’ content only or the cells as such (with all their attributes), which is the default.
    Hence, if you create a new table row, select it and press Ctrl/Cmd-V, all cell attributes will be applied as well.
    Workaround for c+p content only:
    1. Copy the complete table row.
    2. Paste it into a “stupid” text editor like “Notepad” on WIN.
    3. Copy it again in this text editor.
    4. Select the table row in InDesign and press Ctrl/Cmd-V.

Subscribe to the Discussion

Get the ongoing discussion surrounding "Moving A Table Row to a New Position" delivered to you. Click here to subscribe via RSS.

Leave a Reply

You can use limited HTML tags, such as <em></em> for emphasis/italics and <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

InDesignSecrets reserves the right to edit and/or remove posts and comments.