Google spreadsheet allows you to save the table as HTML:

save google spreadsheet as HTML

The problem is that what the HTML you get is not publishable in website or coherent HTML document:

exported google spreadsheet

I'd just like a part of the table as HTML. What can I do?

4 Answers 4


There is a free online service called tableizer. You can select a rectangular data area you want inside google sheets (or other spreadsheet applications) and copy-paste it into the input field of the service:


You receive a basic HTML table source code with your data in it. You can insert the code into an HTML page that you control.

It comes with basic CSS so you can style it to your desire.

If you need to create an html page from it, you have to follow some simple steps:

Open a source code editor and insert this code:

<!DOCTYPE html>


Insert the resulting code from tableizer by pasting it where the empty line is between <body> and </body>.

Save the document with an html ending, like page.html and open the resulting document with your browser to see the result.

  • The tableizer link is awesome.
    – minou
    Commented Apr 12, 2022 at 15:04
  • This is not really the answer I hoped for, since it depends on a service that can go down any time. There's also always risk that the service will steal the data pasted into it. However, it solves the problem and is compatible with other programs as well, so thanks for the answer. Commented Jan 3 at 17:30

I suppose your documents holds data that you do not want to share.

So I would :

  1. add a sheet "public" in which I would copy/paste the data
  2. use the built-in "publish for the web" functionality enter image description here
  3. in the "publish" dialog, limit the publication to the "public" worksheet

Note that, instead of copy/paste (annoying if the data changes frequently) you can use the IMPORTRANGE function.


I solved a similar problem by using the google visualizations API to query data in a publically shared google sheet and draw a chart from the data. Outputting just the table of data should be that much easier.


Create a new sheet and copy the section you want to display into this new sheet. Make sure you use "paste special" to copy formula and that the formula you are copying uses the full cell reference with the sheet name (like 'Sheet 1'!A:A) in order to make the cells in the new sheet point to the cells in the original sheet so that when the original cells are updated, the cells in the new sheet will follow them. Now click on "File" --> "Publish to the web". Now choose "embed" and choose the new sheet. Make sure the "Automatically republish when changes are made" is ticked.

Here is an example of this in action:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.