ysskrishna logoysskrishna

Chapter 4 of 6 · 3 min

Import HTML tables and CSV

Copy a table's HTML from a web page or email, paste CSV with quoted values, and avoid the common splitting errors.

HTML tables

Use HTML Table when you have the table's markup: from a page's source, an exported report, an HTML email, or a docs tool.

<table>
  <tr><th>Plan</th><th>Price</th></tr>
  <tr><td>Free</td><td>$0</td></tr>
  <tr><td>Team</td><td>$12</td></tr>
</table>

Getting the markup

  1. In Chrome, right-click the table → Inspect.
  2. In the Elements panel, right-click the <table> element → Copy → Copy outerHTML.
  3. Paste that into DATA SOURCE with HTML Table selected, choose the destination, Import.

Things to check

  • <th> cells are the natural header row.
  • colspan / rowspan (merged cells) don't map one-to-one to a grid. If the result looks shifted, simplify the HTML or fix it after import. Merging can be redone cleanly with Merge Tools.
  • Links and styles: expect the cell text.

CSV

Sheets has its own CSV import (File → Import), which is the better choice for a CSV file. Table Converter's CSV import is handy when you have CSV text: from a terminal, a log, a chat message or an API.

Quoting rules that matter

name,notes,amount
"Rao, Asha","said ""call me""",1200
Li Wei,,85
  • A value containing a comma, a quote or a line break is wrapped in double quotes.
  • A double quote inside a quoted value is written twice: "".
  • Empty values are just nothing between commas.

If a column splits in the wrong place, a value with a comma was not quoted at the source. Fix the source or quote it before importing.

Other separators

Semicolon-separated "CSV" (common in European exports) and tab-separated text are not comma-separated. Paste tab-separated text straight into Sheets (it splits on tabs natively), or use File → Import with a custom separator.

Step by step: a pricing table from a web page

  1. Inspect the page's pricing table and Copy outerHTML.
  2. Sidebar → Import → HTML Table → paste.
  3. Destination: new sheet → Import.
  4. Clean prices with Text Power Tools (Clean → strip $,) so you can compare them as numbers. See the Text Power Tools course.

Practice: a CSV with quotes

name,company,notes
Asha,"Acme, Inc.","Said ""call after 5"""
Ravi,Globex,

Import with CSV and check: three columns, Acme, Inc. stays in one cell (the quotes protect the comma), the note reads Said "call after 5" (doubled quotes become one), and Ravi's notes cell is empty. If Acme and Inc. land in separate columns, the quotes were lost when the text was copied, often because a chat app or a word processor turned straight quotes into curly ones.

Which import route for which source

SourceBest route
A .csv file on your computerSheets' File → Import (no copy-paste needed)
CSV text in an email, a chat or a logTable Converter, CSV
A table on a public web page=IMPORTHTML(url, "table", 1) if it should stay live; Table Converter HTML Table with the copied markup for a one-off snapshot
A table inside a page you must log in toCopy the <table> markup from the browser's developer tools, then HTML Table

IMPORTHTML refetches the page on its own schedule and fails on pages that need a login or build the table with JavaScript, which is when pasting the markup is the dependable option.

Quick check

  1. How do you copy just a table's HTML from a web page?Inspect it, then right-click the table element → Copy → Copy outerHTML.

  2. How do you write a quote inside a quoted CSV value?Double it: "".

  3. You have a CSV file, not text. Which import is better?Sheets' File → Import.

Continue exploring

ProductGoogle WorkspaceGoogle Sheets Table Converter

Google Sheets Table Converter

Pipe tables, JSON, CSV, or HTML in and out of Sheets, without leaving the grid you are already in.
Google Sheets Table Converter
Markdown & Docs
Text & Data Conversion
Google Workspace Add-ons
BlogCover image for Import JSON, Markdown, HTML & CSV Tables into Google Sheets Without Breaking Data

Import JSON, Markdown, HTML & CSV Tables into Google Sheets Without Breaking Data

Google Sheets Table Converter
Google Workspace Add-ons
+3
2 min read
BlogCover image for Convert Google Sheets to Markdown, HTML, JSON & CSV Without Breaking Tables

Convert Google Sheets to Markdown, HTML, JSON & CSV Without Breaking Tables

Google Sheets Table Converter
Google Workspace Add-ons
+3
2 min read
ProductGoogle WorkspaceGoogle Sheets Tab Manager

Google Sheets Tab Manager

Your workbook outgrew the tab bar. Clean it up in batches.
Google Sheets Tab Manager
Google Workspace Add-ons
Google Sheets
Google Apps Script
CourseCover image for Sheets Tab Manager: Delete, Hide, Rename, Colour and Sort Tabs in Bulk

Sheets Tab Manager: Delete, Hide, Rename, Colour and Sort Tabs in Bulk

Delete multiple tabs in Google Sheets at once, hide and unhide in bulk, rename with find and replace, colour and sort tabs A–Z with the free Sheets Tab Manager.

Google Sheets Tab Manager
Google Sheets
+1

6 chapters · 24 min

ProductGoogle WorkspaceGoogle Sheets Merge Tools

Google Sheets Merge Tools

Repeatable merges in Google Sheets, without the misclick marathon.
Google Sheets Merge Tools
Google Workspace Add-ons
Google Sheets
Google Apps Script