96

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.

2

9 Answers 9

67

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.

8
  • 6
    Is there a reason why your extension adds its Google Analytics stuff to every page?
    – georg
    May 16, 2013 at 12:44
  • 3
    Hi @thg435, no not really other than I followed the guide on 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 github.com/jamesandres/ColumnCopy and submit a pull request if you find a better approach. Thanks :) May 22, 2013 at 16:10
  • This extension is great, but it strips html and links. Any way around that? Aug 18, 2013 at 18:41
  • 1
    -1 because it ain't do it like firefox does :) It's not selecting, it's copying already.
    – hakre
    May 14, 2014 at 7:29
  • 1
    +1 Great work! It solved my problem. But as hakre said, it's better to have more features like selecting,
    – lesca
    Jul 5, 2016 at 1:00
35

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.

1
  • 4
    Until the table has 25 columns and 35k rows with a total size of almost 2 MB for the full contents as text :) Dec 8, 2015 at 8:14
22

Here's another one (mine): copytables.

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

4
  • you wrote this extension? You are the best. this is by for the best extention for this purpose! 5 star
    – matthy
    Nov 20, 2015 at 14:34
  • @hakre this one works like Firefox does!
    – arekolek
    Dec 14, 2015 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, 2016 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. May 11, 2018 at 4:35
9

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.

2
  • Clever hack. But a hack!
    – mdoar
    Sep 15, 2011 at 17:01
  • This is good because it doesn't require installing any extensions. Jan 10, 2018 at 14:14
5

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"]

3

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.
2
  • 1
    Link only answer is useless, especially when it will be broken. Can you elaborate on this a little more?
    – Toto
    Jun 13, 2018 at 17:29
  • Hello please recheck the link its updated. sorry for the broken link
    – Java
    Jun 14, 2018 at 13:53
2

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.

0
2

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.

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!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .