Embeds a published, public Google Spreadsheet in a WordPress post or page as an HTML table.
Fetches a published Google Spreadsheet using a [gdoc key=""] WordPress shortcode, then renders it as an HTML table, embedded in your blog post or page. The only required parameter is key, which specifies the document you'd like to retrieve. Optionally, you can also strip a certain number of rows (e.g., strip="3" omits the top 3 rows of the spreadsheet) and you can supply a table summary, <caption> and customized class value.
For example, to display the spreadsheet at https://spreadsheets.google.com/pub?key=ABCDEFG, use the following shortcode in your WordPress post or page:
[gdoc key="ABCDEFG"]
Currently, this plugin only supports Google Spreadsheets that are "Published as a web page" and therefore public. Private Google Docs are not supported (yet).
To render the HTML table with additional metadata, you can also do the following:
[gdoc key="ABCDEFG" class="my-sheet" summary="An example spreadsheet, with a summary."]This is the table's caption.[/gdoc]
The above shortcode will produce HTML that looks something like the following:
<table id="igsv-ABCDEFG" class="igsv-table my-sheet" summary="An example spreadsheet, with a summary.">
<caption>This is the table's caption.</caption>
<!-- ...rest of table code using spreadsheet data here... -->
</table>
You can use the gid attribute to embed a worksheet other than the first one (the one on the far left). For example, to display a worksheet published at https://spreadsheets.google.com/pub?key=ABCDEFG&gid=4, use the following shortcode in your WordPress post or page:
[gdoc key="ABCDEFG" gid="4"]
The header_rows attribute lets you specify how many rows should be rendered as the table header. For example, to render a worksheet's top 3 rows inside the <thead> element, use:
[gdoc key="ABCDEFG" header_rows="3"]
Requires: 2.7 or higher
Compatible up to: 3.3.2
Last Updated: 2012-4-25
Downloads: 6,082
Got something to say? Need help?