本文介绍了删除标题&已发布的Google文档电子表格中的页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了javascript解决方案,用于在Google文档电子表格中删除网格线(使用下载为HTML,然后通过JavaScript在Web地址栏中):工作太棒了!

  javascript:var v =none,e =defaultView,o =border,m =Color,w = function(a,b){if ] a {if(document [e] .getComputedStyle(a,null)[o + b + m] ==rgb(204,204,204))a.style [o + b] = v} else if a.currentStyle [o + b + m] ==#ccc)a.style [o + b] =none},q = function(a){a = window.document.getElementsByTagName(a); for (c,Left); w(c,Right); w(c,Bottom);(var b = 0; b   

想知道是否可以使用类似的javascript来删除文档的页眉和页脚 到网络?
发布的电子表格有一个
- > header:filename + sheetname;
- > footer:编辑此页(如果您有权限) - 由Google文档发布 - 举报滥用行为 - 每5分钟自动更新
- >示例:(我已经在网址中添加了& gridlines = false以删除网格线)



为什么以前的解决方案不够用?
我希望有些人查看和打印电子表格(通过发布到网络),而不让他们访问(查看)电子表格本身。因此,他们不能使用下载为HTML+您的javascript,但希望提供一个网址来查看已发布的网站,并且能够在没有Google页眉和页脚的情况下进行整洁打印。

$



 < div id = header> ...< / div> 
< div id =content> ...< / div>
< div id =footer> ...< / div>

您可以编写一个这样的函数来隐藏页眉和页脚。

  var f = function(id)
{
document.getElementById(id).style.display =none;
};
f(header);
f(footer);

或复制粘贴版本:

  javascript:var f = function(id){document.getElementById(id).style.display =none;}; f(header); f(footer); 


I found javascript solution for removing gridlines on Google docs spreadsheets (using "download as HTML" and then past javascript in Web Address Bar): works great !!

javascript:var v="none",e="defaultView",o="border",m="Color",w=function(a,b){if(document[e]){if(document[e].getComputedStyle(a,null)[o+b+m]=="rgb(204, 204, 204)")a.style[o+b]=v}else if(a.currentStyle[o+b+m]=="#ccc")a.style[o+b]="none"},q=function(a){a=window.document.getElementsByTagName(a);for(var b=0;b<a.length;b++){var c=a[b];w(c,"Left");w(c,"Right");w(c,"Bottom");w(c,"Top")}};q("td");q("table");

Was wondering if it is possible to make a comparable javascript to remove the header and footer for docs "publised" to the web?! Published spreadsheets have a -> header: filename + sheetname; -> footer: "Edit this page (if you have permission) – Published by Google Docs – Report Abuse – Updated automatically every 5 minutes"-> example: TEST (I already added "&gridlines=false" to the url to remove gridlines).

Why is previous solution not sufficient ?!I want some people to view and print the result of a spreadsheet (via publish to web) without giving them access (view) to the spreadsheet itself. Therefore they can't use "download as HTML" + your javascript, but want to provide a url to view a published site and be able to make a neat print without the Google header and footer.

Would be great if anyone could help out!

Regards,

解决方案

Thankfully the layout on this page is super simple.

<div id="header">...</div>
<div id="content">...</div>
<div id="footer">...</div>

You could write a function like this to hide the header and footer.

var f = function(id)
{
    document.getElementById(id).style.display = "none";
};
f("header");
f("footer");

Or the copy paste version:

javascript:var f=function(id){document.getElementById(id).style.display="none";};f("header");f("footer");

这篇关于删除标题&amp;已发布的Google文档电子表格中的页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 16:26