4

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?

1

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.

1

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.

0

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:

http://tableizer.journalistopia.com/

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>
<html>
<body>

</body>
</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.

0

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:

https://mikeostest.wixsite.com/content

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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