100

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,196
kristof
  • 1,752

9 Answers9

68

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.

37

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.

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
  • 319
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.

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.
Java
  • 29
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.

akuiper
  • 121
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.

Brad Parks
  • 3,253
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