Wednesday, April 20, 2011

yogi_Publish A SingleCell Or A Range Of Cells Without Title SheetName ScrollBars

Yogi Anand, D.Eng, P.E.                                         Google Spreadsheet                  
Manticore said:
I'd like to embed a single cell from a spreadsheet on my web site. I basically know how to do it, and I can get rid of the sheet name, but I'm still getting 'extra' stuff - I just want the cell.  Nothing else!
 I'm managing a few sites for a couple marinas, and I have their fuel prices listed on their main page.  As you can imagine, those prices change frequently.  This is a side-gig - I have real job - so when they let me know they need changes I have to wait till I can get to my computer and update the page in Dreamweaver and then republish the page.  Not a big deal, but I'd love to just be able to go into google docs, update he price and have it update on the page.  Does that make sense, or am I way off base?!
From within the spreadsheet, 
click on File ... 
then click on Publish as a web page
Sheets to publish ... Sheet1 (or the sheet of interest if other than Sheet1)
check the box ... Automatically republish when changes are made 
then click on Start publishing
in Get a link to the published data choose HTML to embed in a page
Choose Sheet1 (or sheet of interest if other than Sheet1)
for range ... key-in A1 (or another cell(s) if other than A1)

in the iframe code that is generated ... change &widget=true to &widget=false

use this iframe code in your web page -- you will also have to adjust the
width of the cell(s) to be published and the width paraneter in the iframe 
code to get it just right so that only the contents of the cell are published
without the scroll bars

see the illustration below