1

My iframe code:

<iframe height="750" style="width:100%" src="https://docs.google.com/spreadsheets/d/<?=$google_sheet_id;?>/edit?rm=minimal#gid=<?=$_SESSION['customers_gid'];?>"></iframe>

that displays Google Sheets with all sheets like:

Several tabs

i want to display only Customers sheet.

0

1 Answer 1

-1

Pretty late, but simple answer to future buddies.

Open google docs > click on "File" > Share > Publish to web > it will ask you to Share "All docs" or Sheet1 or Sheet2 > select which one you want.

Then you will get code something like

<iframe      src="https://docs.google.com/spreadsheets/d/e/2PACX-1vQrvFsPs7Fpkaao0XvwIUc54WwPsQ4zzlyaEYV6-4JsSEfgZA4YLJpTwlA1pgurUvVCxRzBQ_8OqFJa/pubhtml?                   gid=23663673&amp;single=true&amp"

Extra code and its explanation, add it before < / iframe >. Also "amp" at end will be constant but true, false can be changed according to your needs.

  1. For setting size -

    height="410" width="100%"

  2. For hiding Sheet1, Sheet2, Sheet3 options while showing on site -

    widget=false&amp

  3. For hiding header option of sheet -

    headers=false&amp

  4. For hiding title bar showing the spreadsheet name above the sheet -

    chrome=false&amp

  5. For selecting data of specific range (A1 and B19 is range, so change them accordingly, but don't change "%3A" in it, as it works as : this symbol here, if you use : it will show error -

    range=A1%3AB19

Full code will look like

<iframe src="https://docs.google.com/spreadsheets/d/e/2PACX-1vQrvFsPs7Fpkaao0XvwIUc54WwPsQ4zzlyaEYV6-4JsSEfgZA4YLJpTwlA1pgurUvVCxRzBQ_8OqFJa/pubhtml?           gid=1273789&amp;widget=false&amp;headers=false&amp;chrome=false&amp;range=A1%3AB19" height="410" width="100%" ></iframe>

make sure to add ; after amp

If you want embed editable sheet then follow How to embed specific editable cells from a google sheet into a site

2
  • If &amp; meaning is not clear have a look at this question: stackoverflow.com/questions/9084237/what-is-amp-used-for
    – xonya
    May 21, 2022 at 8:37
  • @xonya Thanks for adding it. I just avoided it! One request, only if my answers solve this problem can I get Up - .vote. As I'm new and not able to perform certain imp. things, I just want it to reach 50 then I will be able to do all I wanted.
    – Gmaster
    May 26, 2022 at 10:42

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