Embed part of website

戏子无情 提交于 2019-12-05 02:03:57

问题


I want to embed just this part on my website. How do I do that? I have tried with iframe and it shows me the whole page I just want the table!


回答1:


If you do know the id of the div the table is in you can do something like this

HTML

<div id="PlaceToPutTable"></div>
<iframe id="iframe" src="urlofpagewithtableonit.html" style="display:hidden;"></iframe>

Javascript

var iframe = document.getElementById("iframe");
var div = document.getElementById("PlaceToPutTable");
div.innerHTML = iframe.contentWindow.document.getElementById("KnowDivName").innerHTML;

Hope this helps.




回答2:


You can put the part of an external website starting at some id into an iframe, like this. Or you can put an iframe into a div like this.




回答3:


You can copy paste html code like this

<iframe width="500" height="300" style="border:none;" src="https://www.rowshare.com/embed/5ff17f44bcb240e0be061e26c0aca207"></iframe>

When embedding a table in a website, automatic update can be a challenge. I'd like to propose an alternative tool called RowShare, that allows an automatic update. I explained about this in an article that I wrote. Please feel free to take a look at it: https://www.rowshare.com/blog/en/2017/10/10/How-to-Embed-Tables-in-Your-Website

Astaeka



来源:https://stackoverflow.com/questions/7018379/embed-part-of-website

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!