From the course: InDesign Secrets
232 Swapping column and row information in tables - InDesign Tutorial
From the course: InDesign Secrets
232 Swapping column and row information in tables
- [Voiceover] Sometimes you have a table in InDesign in which you want to swap, or switch, the columns and rows. For example, I might want all the information in this first row to become part of the first column, and the second row should be the second column, and so on. Now, there's no obvious way to do this in InDesign, but you can do it with a little trick, in fact, three tricks. You could use Excel, you could use a free script, or you could use an excellent plugin. I'll show you all three, but first, let me show you how you can do it in Excel. Now, the Excel trick works best when your table is relatively simple and you don't have any formatting, like this one. To get the data into Excel, we first need to select all the cells in the table. I can do that by simply placing my text cursor inside any one of the cells, and then pressing cmd + opt + a on the Mac, or ctrl + alt + a on Windows. That selects all the cells. Then, I'll copy all that data to the clipboard by pressing Command + C on the Mac, or Control + C on Windows. Now, I'll switch to Excel, and you can see I have a blank worksheet open here. All I need to do is paste, Command + V or Control + V on Windows. You can see all that data shows up inside the Excel document. OK, so there's the data, looking pretty much the same as it did in InDesign, except it's not formatted. I now need to deselect these cells, and then select them again and copy them to the clipboard one more time. Yes, you really do need to select and copy all those cells again in order to take advantage of a special Excel feature, which you can find in the Edit menu. First, I'll select any other cell down here, then I'll go to the Edit menu, and I'll choose Paste Special. The Paste Special dialog box gives me all kinds of options, but all I need to do here is turn on the Transpose check box, and click OK. The data is pasted back into this worksheet, and you can see that it's now transposed. What was a column is now a row, and vice versa. Now I can copy those cells one last time, head back to InDesign, but before I paste, I need to pay attention to something. This table, the original table, had four columns and five rows. However, my new table is going to have just the opposite. Before I paste, I want to make sure my table has the right number of columns and rows. I can change that up here in the control panel. I'll change this to four rows instead of five, and InDesign warns me that it's going to delete some of the data, that's OK, and I'm going to add one column. There we go. I now have the right number of rows and columns, so now I can paste with Command + V or Control + V on Windows. There you go. All the data is put back in the table, but in the new order. Oh, actually, I should point out two reasons why this might not work for you. For some people, when they paste, the whole table ends up sitting inside the first cell of the InDesign table. If that happens to you, then you might not have had all the cells selected when you pasted, or you might need to make a small change to your preferences. I'll open my Preferences dialog box by going to the InDesign menu on the Mac, or the Edit menu on Windows, and then choosing Preferences. Inside the Preferences sub-menu, I'm going to choose Clipboard Handling. Inside the Clipboard Handling pane of the Preferences dialog box, I want to make sure that this When Pasting Text and Tables from Other Applications section is set to Text Only. If I choose All Information, then sometimes, those pasted tables don't come in correctly. When I'm pasting tables, I want to choose Text Only. I'll just cancel out of this dialog box, because in this case, it worked just fine, As I said, this technique using Excel works pretty well when you have a simple table, but I'll scroll down just a little bit here, and you can see I have a little bit more complicated table here. It's formatted, it has more rows, and so on. This is where the second solution comes in. When I was researching this problem of transposing rows and columns, I discovered an old script from way back in 2006, written by Iain Anderson. You can find this script on his blog, called funwithstuff.com, and amazingly, this old script seems to work just as well today in InDesign CC as it did back then. Now, we've covered how to download and install scripts in another InDesign Secrets movie, here in the online training library, so I'm not going to cover that here. I've already downloaded and installed this one, and you can see it back here in InDesign, inside my Scripts panel, which I can find by going to the Window menu, choosing Utilities, and then choosing Scripts. There it is; Table Transpose. Now, I should point out that when you run this script, you need to select not the table, but the text frame that contains the table. I'll choose the Selection tool, the black arrow Selection tool, select this text frame here, and then run the script by double-clicking on it. Boom! In just a few seconds, the rows and columns are all switched. I love that!. The last method that I want to point out is the Active Tables plugin, and you can find that on the DTP Tools site at dtptools.com. This plugin is a commercial tool, that is, you do have to pay extra for it, but it has a wide array of cool table features, not just transposing tables, but far more, like doing table calculations. It can actually do the math inside your tables. Now, I'm not going to demo this plugin, but if you do a lot with tables, you should definitely check it out to see if it would save you time. Lastly, I do want to point out that if your table is complicated, particularly if it has merged or split cells, then all bets are off with any of these techniques. There's really no good way to transpose those, but, for a simple table that needs flipping, any of these techniques should do the trick.
Download courses and learn on the go
Watch courses on your mobile device without an internet connection. Download courses using your iOS or Android LinkedIn Learning app.
Contents
-
-
229 Batch converting ID files to current version with the Book panel6m 9s
-
230 Getting around InDesign limitations6m 46s
-
(Locked)
231 Creating better callout lines with effects and object styles5m 47s
-
232 Swapping column and row information in tables6m 9s
-
(Locked)
233 Making bigger text link targets4m 52s
-
-
-
161 Keeping page numbers on top of master items3m 55s
-
162 Adding automatic currency symbols in a table cell or before text3m 50s
-
(Locked)
163 Make a pop-up footnote for your ebook3m 48s
-
(Locked)
164 Deleting tabs at the beginning of paragraphs and applying a paragraph style3m 10s
-
(Locked)
165 Five InDesign Presentation tips6m 28s
-
-
-
(Locked)
111 Packaging images on the pasteboard3m 32s
-
(Locked)
112 Automatically updating figure references for books6m 9s
-
(Locked)
113 Adding Tool Tips to your form fields in InDesign3m 21s
-
(Locked)
114 Setting poetry, flush left, center on longest line3m 54s
-
(Locked)
115 Use bookmarks to navigate long documents in production4m 57s
-
(Locked)
-
-
(Locked)
107 Using the same keyboard shortcut for two different commands with the Context feature5m 22s
-
(Locked)
108 Making a text highlighter3m 33s
-
(Locked)
109 Updating an interactive PDF without losing work done in Acrobat5m 30s
-
(Locked)
110 Adding custom text at the beginning of each line automatically4m
-
(Locked)
-
-
(Locked)
089 Three great Object Styles for any designer8m 1s
-
(Locked)
090 Choosing alpha channel image transparency2m 25s
-
(Locked)
091 Adding and reading metadata for InDesign files3m 25s
-
(Locked)
092 Adding ALT tags to your images6m 59s
-
(Locked)
093 How to Place & Link a text frame's text but not its formatting7m 4s
-
(Locked)
094 Setting the baseline position of a caption2m 39s
-
(Locked)
-
-
(Locked)
051 Five things that should be in every new file5m 19s
-
(Locked)
052 Forcing EPUB page breaks with invisible objects6m 21s
-
(Locked)
053 Understanding component information6m 39s
-
(Locked)
054 Creating running heads using section markers4m 16s
-
(Locked)
055 Making a font with InDesign using the IndyFont script5m 20s
-
(Locked)
056 Finding where that color is used7m 17s
-
(Locked)
-
-
(Locked)
047 Specifying an exact amount of space between objects5m 17s
-
(Locked)
048 Fixing last lines that are too short8m 16s
-
(Locked)
049 Creating web graphics from your InDesign artwork7m 20s
-
(Locked)
050 Using “No Language” to suppress unwanted hyphenation, spell-checking, and smart quotes2m 48s
-
(Locked)
-
-
(Locked)
037 Updating a linked table without losing formatting5m 18s
-
(Locked)
038 Creating electronic sticky notes4m 49s
-
(Locked)
039 Moving master page items to the top layer for visibility2m 48s
-
(Locked)
040 Five guide tricks that will impress your coworkers6m 18s
-
(Locked)
041 Letting InDesign add the diacritics4m 21s
-
(Locked)
042 Using single-cell table cells for custom paragraph formatting6m 2s
-
(Locked)
-
-
(Locked)
027 Creating running heads using variables5m 1s
-
(Locked)
028 Live Caption tips and tricks8m 3s
-
(Locked)
029 Making professional drop caps10m 37s
-
(Locked)
030 Making two-state buttons in interactive documents5m 5s
-
(Locked)
031 Moving pages from one document to another3m 15s
-
(Locked)
032 Wrapping bulleted text around a curve5m 58s
-
(Locked)
-
-
(Locked)
007 Selecting through and into objects using cmd-click and Select Above/Below5m 46s
-
(Locked)
008 Some great tips and tricks for the Swatches panel9m 40s
-
(Locked)
009 Saving down for backward compatibility with INX and IDML5m 54s
-
(Locked)
010 Using the INX and IDML formats to fix problems4m 46s
-
(Locked)