Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9236915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:24:50+00:00 2026-06-18T07:24:50+00:00

I want to embed a Google spreadsheet without the header and footer. This post

  • 0

I want to embed a Google spreadsheet without the header and footer. This post shows the trick, but doesn’t say how to apply it. I tried this, but it doesn’t work:

<iframe id="embeddedthing" width='500' height='300' frameborder='0' src='https://docs.google.com/spreadsheet/pub?key=<DocId>&single=true&gid=12&output=html&widget=false&gridlines=false'></iframe>
<script type="text/javascript">
  var f = function(id) {document.getElementById(id).style.display = "none";};
  f("header");
  f("footer");
</script>

Then I thought I should apply it to the document loaded in the iframe, so I tried to access it using document.getElementById('FrameId').contentWindow.document, but the browser says “Unsafe JavaScript attempt to access frame” and doesn’t allow me to continue.

What is the correct way to run that JavaScript function?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:24:52+00:00Added an answer on June 18, 2026 at 7:24 am

    The easiest way to remove headers and footers from a shared Google sheet in an iframe is to specify the sheet and the range to show.
    With the following syntax a sheet appears nice and clean, with the exception of a thin gray border on the top and left edge:

    src="https://docs.google.com/spreadsheet/pub?key=<DocID>&gid=<SheetID>&gridlines=false&range=A1:Z100"

    Without the range parameter the behavior is affected by the widget=true to show a header row on top or widget=false to show headers, footers and links to the other sheets.
    If the specified range is larger than the actual sheet size, the whole sheet is used. So range=A1:Z100 will cover most cases with small tables.

    Creating two adjacent iframes allows to do something similar to the frozen column or row headers.
    Here is an example of a page that uses this technique to display 2 fixed columns with the headers on the left and a scrollable area on the right:

    <table border='1'>
      <tr>
        <td>
          <iframe width="103" height="187" frameborder="0" src="https://docs.google.com/spreadsheet/pub?key=0AqEyi7du69LQdHRJXzViMlhEdHVYY2E4X1hnZ21EQ2c&gid=29&gridlines=false&range=A1:B999"></iframe>
        </td>
        <td>
          <iframe width="600" height="187" frameborder="0" src="https://docs.google.com/spreadsheet/pub?key=0AqEyi7du69LQdHRJXzViMlhEdHVYY2E4X1hnZ21EQ2c&gid=29&gridlines=false&range=C1:CC999"></iframe>
        </td>
      </tr>
    </table>
    

    This is the website that uses this technique.

    EDIT

    Google has changed something and my website is suddenly broken.

    The solution as suggested here is to add &widget=false&chrome=false.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm created a div and embed Google Map code. Like this: But, i want
I want to embed this gadget in my web page. That's why I use
I want to Embed SVG into XUL. I tried to use the this tutorial
Take this scenario. I have a Google Analytics tracking code, and I only want
I want to embed data directly inside of a GCM (Google Cloud Message) in
I want to embed a VLC player in my webapp build with Google's GWT.
Hi I want to use google map in my application but I also want
I have an html form and I want to embed google map so the
I want to embed the google home page in a page on my website.
I want to embed a dsl or existing full language within my application. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.