Google spreadsheet allows you to save the table as HTML:
The problem is that what the HTML you get is not publishable in website or coherent HTML document:
I'd just like a part of the table as HTML. What can I do?
Web Applications Stack Exchange is a question and answer site for power users of web applications. It only takes a minute to sign up.
Sign up to join this communityGoogle spreadsheet allows you to save the table as HTML:
The problem is that what the HTML you get is not publishable in website or coherent HTML document:
I'd just like a part of the table as HTML. What can I do?
I suppose your documents holds data that you do not want to share.
So I would :
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.
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.
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: