Control the container size of Google Sheets in posts?
Sept 7, 2018 11:06:57 GMT -8
saltin likes this
Post by Retread on Sept 7, 2018 11:06:57 GMT -8
Forum URL: guitarnuts2.proboards.com
What I'm hoping for is a BBCode solution that will allow me to define the height and width of the container for a gdoc embed in a post. If it can be done at that level, I can tailor the display according to the needs of each particular sheet and post.
Background:
By applying attributes and values to to the iframe tag in html, I can define the container size when embedding a sheet in a custom page.
For instance, this:
<!DOCTYPE html>
<html>
<style>
.center {
width: 675px;
padding: 50px 0px;
margin: auto;
margin-top: 20px;
margin-bottom: 20px;
background-color: #aaaaaa;
}
</style>
<head>
</head>
<body>
<div class="center">
<iframe width="575" height="660" src="https://docs.google.com/spreadsheets/d/e/2PACX-1vTgNEEpZzZLrvtCXQqBNMOLb-6hhHIRLhUjpMRHThlnMWoj39BY31qgtd4bknQUuZna6N4y80VS2cl0/pubhtml?widget=true&headers=false"></iframe>
</div>
</body>
</html>
Results in this:
guitarnuts2.proboards.com/page/g-sheet-test
No 'whitespace' wasted in the width. No scrollbar needed for the height. Life is good.
In a post environment I have less control. Unlike a div tag, the gdoc tag doesn't seem to accept attributes and values.
With a simple gdoc tag for the same sheet...
This:
Results in this:
To get rid of the whitespace to the right, make a narrower container, and center things up, I can employ some 'malformed usage' (as Chris might say) of the attributes and values with div tags to squeeze the width of the gdoc container.
This:
Results in this:
However, I still have a scrollbar for the vertical which I would very much like to get rid of by displaying a taller container.
EDIT:
The Support Forum is using a much narrower width than my forum so the BBCode example looks different here.
What I'm hoping for is a BBCode solution that will allow me to define the height and width of the container for a gdoc embed in a post. If it can be done at that level, I can tailor the display according to the needs of each particular sheet and post.
Background:
By applying attributes and values to to the iframe tag in html, I can define the container size when embedding a sheet in a custom page.
For instance, this:
<!DOCTYPE html>
<html>
<style>
.center {
width: 675px;
padding: 50px 0px;
margin: auto;
margin-top: 20px;
margin-bottom: 20px;
background-color: #aaaaaa;
}
</style>
<head>
</head>
<body>
<div class="center">
<iframe width="575" height="660" src="https://docs.google.com/spreadsheets/d/e/2PACX-1vTgNEEpZzZLrvtCXQqBNMOLb-6hhHIRLhUjpMRHThlnMWoj39BY31qgtd4bknQUuZna6N4y80VS2cl0/pubhtml?widget=true&headers=false"></iframe>
</div>
</body>
</html>
Results in this:
guitarnuts2.proboards.com/page/g-sheet-test
No 'whitespace' wasted in the width. No scrollbar needed for the height. Life is good.
In a post environment I have less control. Unlike a div tag, the gdoc tag doesn't seem to accept attributes and values.
With a simple gdoc tag for the same sheet...
This:
[gdoc]https://docs.google.com/spreadsheets/d/e/2PACX-1vTgNEEpZzZLrvtCXQqBNMOLb-6hhHIRLhUjpMRHThlnMWoj39BY31qgtd4bknQUuZna6N4y80VS2cl0/pubhtml?[/gdoc]
Results in this:
To get rid of the whitespace to the right, make a narrower container, and center things up, I can employ some 'malformed usage' (as Chris might say) of the attributes and values with div tags to squeeze the width of the gdoc container.
This:
[div align="center"][div style="overflow:auto;padding:50px;background-color:#777777;width:625px;" align="center"][gdoc]https://docs.google.com/spreadsheets/d/e/2PACX-1vTgNEEpZzZLrvtCXQqBNMOLb-6hhHIRLhUjpMRHThlnMWoj39BY31qgtd4bknQUuZna6N4y80VS2cl0/pubhtml?[/gdoc]
Results in this:
However, I still have a scrollbar for the vertical which I would very much like to get rid of by displaying a taller container.
- Is there already a solution of which I am not aware?
- If not, would allowing attributes for width and height of a gdoc be a reasonable feature request?
EDIT:
The Support Forum is using a much narrower width than my forum so the BBCode example looks different here.