94

Is there an extension for Google Chrome that would allow me to select a column from a table on the webpage? For example when I want to copy text from just one column of a table.

You can select any row or column in Firefox by holding the Ctrl key, and I was wondering if a similar feature is available in Chrome.

unor
  • 3,066
  • 3
  • 27
  • 54
kristof
  • 1,682
  • 7
  • 21
  • 21

9 Answers9

65

Sorry to dig up an old thread, but this might help someone in the future. I wrote a Chrome extension called ColumnCopy which accomplishes this task.

James Andres
  • 782
  • 6
  • 3
  • 5
    Is there a reason why your extension adds its Google Analytics stuff to every page? – georg May 16 '13 at 12:44
  • 3
    Hi @thg435, no not really other than I followed the guide on http://developer.chrome.com/extensions/tut_analytics.html. My goal was to track to copy column vs. copy table events. That info is helpful for improving the app. You are welcome to check out the code at https://github.com/jamesandres/ColumnCopy and submit a pull request if you find a better approach. Thanks :) – James Andres May 22 '13 at 16:10
  • This extension is great, but it strips html and links. Any way around that? – Artem Russakovskii Aug 18 '13 at 18:41
  • @ArtemRussakovskii not at the moment. A few people have requested this and there is a ticket open for it here https://github.com/jamesandres/ColumnCopy/issues/7. I'll get to it as free time permits. Feel free to submit a patch! – James Andres Aug 27 '13 at 14:04
  • 1
    -1 because it ain't do it like firefox does :) It's not selecting, it's copying already. – hakre May 14 '14 at 07:29
  • 1
    +1 Great work! It solved my problem. But as hakre said, it's better to have more features like selecting, – lesca Jul 05 '16 at 01:00
  • I installed and used your extension, worked on a w3schools table example page, didn't work in the HTML table (I checked source, WAS table.) document I was trying. So I deactivated it. Tried another extension on this page in same way. After I was done, I suddenly realized my clipboard STOPPED WORKING altogether. Have to reboot! Don't know which one it is, obviously. – Dreamspace President May 11 '18 at 04:31
  • Doesn't work for me. It copies the entire column, but doesn't allow selection like Firefox. – mbomb007 Apr 23 '20 at 17:13
34

Another hack - copy the whole table from Chrome to Excel then copy the column. I use this to grab the stock ticker column from a stock screen.

Works using LibreOffice Calc as well.

J Kent Berkeley
  • 341
  • 3
  • 3
21

Here's another one (mine): copytables.

Allows you to select columns, rows and arbitrary areas in a table and copy in different formats.

georg
  • 311
  • 2
  • 4
  • you wrote this extension? You are the best. this is by for the best extention for this purpose! 5 star – matthy Nov 20 '15 at 14:34
  • @hakre this one works like Firefox does! – arekolek Dec 14 '15 at 21:34
  • Should be voted much higher. Thanks for the shortcuts and the decent context menu, in case you forget them. Good work. – Avatar Aug 14 '16 at 14:59
  • I installed and used your extension, worked on a w3schools table example page, didn't work in the HTML table (I checked source, WAS table.) document I was trying. So I deactivated it. Tried another extension on this page in same way. After I was done, I suddenly realized my clipboard STOPPED WORKING altogether. Have to reboot! Don't know which one it is, obviously. – Dreamspace President May 11 '18 at 04:35
8

Here's a very hacky and somewhat inconvenient workaround: you can use the "Transpose Tables" bookmarklet located on this website to transpose the rows and columns of the tables on the page, and then select the appropriate row. Certainly not ideal, but it's the best thing I was able to find.

Mitch Lindgren
  • 162
  • 1
  • 10
4

Without installing any extension:

Open console and type:

document.getElementsByTagName('table')

If there is more than one, use the index for the desired table. In my case I want the first table so I use 0 as the index:

document.getElementsByTagName('table')[0]

Define column you want (first column is 0):

column = 0

And this is the final code:

Array.from(document.getElementsByTagName('table')[0].getElementsByTagName('tr'))
    .map(tr => tr.getElementsByTagName('td'))
    .filter(td => td.length > 0)
    .map(td => td[column].innerHTML)

Now you have the output, which you can copy from the console, e.g. ["Item 1", "Item 2", "Item 3"]

Michal Kováč
  • 201
  • 2
  • 4
2

here is another column/cell copy extension for Chrome Browser. https://chrome.google.com/webstore/detail/table-range-select-and-co/klojbfbefcejadioohmnkhjmbmecfapg

  • Alt + Click selects single cells.
  • Ctrls + Click + move selects table ranges exactly like in Firefox.
Java
  • 21
  • 2
  • 1
    Link only answer is useless, especially when it will be broken. Can you elaborate on this a little more? – Toto Jun 13 '18 at 17:29
  • Hello please recheck the link its updated. sorry for the broken link – Java Jun 14 '18 at 13:53
1

For anyone who still has the problem, here is another chrome extension isheet you may want to try out. Unlike some other suggestions here, this extension scrapes html table into an excel like sheet from where you can easily copy the whole column. Bonus of this extension is that it not only works for standard html table but also other tabular format html elements, such as list or any periodic data structure.

Psidom
  • 111
  • 2
1

You could also use either of these bookmarklets:

http://w-shadow.com/bookmarklet-combiner/?bookmarklet=2125 http://www.kunalbabre.com/projects/table2CSV.php

to copy out the data as CSV. Then paste that CSV data into excel, and click the column you want in excel and copy that.

Brad Parks
  • 2,918
  • 3
  • 25
  • 35
0

Here is a simple method, working only on Mac, which uses the Mac's default app (TextEdit). It uses the TextEdit's support for columnar selection.

  1. Open a new TextEdit document in a rich text format.
  2. Select, copy, & paste the online table into the open TextEdit file, which will keep the table intact.
  3. Select the text in a column(s) with the Option key pressed, which allows one to select anything inside a rectangular area that you draw, similar to Photoshop's rectangular lasso tool. Copy the selection and paste to wherever you need.

Cheers!

Rev
  • 1