{"id":53416,"date":"2024-12-03T10:23:56","date_gmt":"2024-12-03T02:23:56","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53416\/"},"modified":"2024-12-03T10:23:56","modified_gmt":"2024-12-03T02:23:56","slug":"%e5%a6%82%e4%bd%95%e5%b0%86%e5%8a%a8%e6%80%81%e7%94%9f%e6%88%90%e7%9a%84-html-%e8%a1%a8%e6%a0%bc%e6%8f%92%e5%85%a5-iframe-%e4%bb%a5%e5%ae%9e%e7%8e%b0%e5%af%bc%e5%87%ba-excel-%e5%8a%9f%e8%83%bd-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53416\/","title":{"rendered":"\u5982\u4f55\u5c06\u52a8\u6001\u751f\u6210\u7684 HTML \u8868\u683c\u63d2\u5165 iframe \u4ee5\u5b9e\u73b0\u5bfc\u51fa Excel \u529f\u80fd\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5982\u4f55\u5c06\u52a8\u6001\u751f\u6210\u7684 HTML \u8868\u683c\u63d2\u5165 iframe \u4ee5\u5b9e\u73b0\u5bfc\u51fa Excel \u529f\u80fd\uff1f<\/h1>\n<p>\u77e5\u8bc6\u70b9\u638c\u63e1\u4e86\uff0c\u8fd8\u9700\u8981\u4e0d\u65ad\u7ec3\u4e60\u624d\u80fd\u719f\u7ec3\u8fd0\u7528\u3002\u4e0b\u9762\u7c73\u4e91\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u4e2a\u6587\u7ae0\u5f00\u53d1\u5b9e\u6218\uff0c\u624b\u628a\u624b\u6559\u5927\u5bb6\u5b66\u4e60\u300a\u5982\u4f55\u5c06\u52a8\u6001\u751f\u6210\u7684 HTML \u8868\u683c\u63d2\u5165 iframe \u4ee5\u5b9e\u73b0\u5bfc\u51fa Excel \u529f\u80fd\uff1f\u300b\uff0c\u5728\u5b9e\u73b0\u529f\u80fd\u7684\u8fc7\u7a0b\u4e2d\u4e5f\u5e26\u5927\u5bb6\u91cd\u65b0\u6e29\u4e60\u76f8\u5173\u77e5\u8bc6\u70b9\uff0c\u6e29\u6545\u800c\u77e5\u65b0\uff0c\u56de\u5934\u770b\u770b\u8bf4\u4e0d\u5b9a\u53c8\u6709\u4e0d\u4e00\u6837\u7684\u611f\u609f\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241130\/1732939953674a90b1027c4.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5c06\u52a8\u6001\u751f\u6210\u7684 HTML \u8868\u683c\u63d2\u5165 iframe \u4ee5\u5b9e\u73b0\u5bfc\u51fa Excel \u529f\u80fd\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u5c06\u52a8\u6001\u751f\u6210\u7684 HTML \u8868\u683c\u63d2\u5165 iframe \u4ee5\u5b9e\u73b0\u5bfc\u51fa Excel \u529f\u80fd\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5c06 html \u5143\u7d20\u52a8\u6001\u63d2\u5165 iframe<\/strong><\/p>\n<p>\u672c\u6587\u8ba8\u8bba\u4e86\u5982\u4f55\u5728 iframe \u4e2d\u52a8\u6001\u63d2\u5165 html \u5143\u7d20\u4ee5\u6ee1\u8db3\u5c06\u8868\u8f6c\u6362\u6210 excel \u7684\u8981\u6c42\u3002<\/p>\n<p>\u5728\u63d0\u4f9b\u7684\u95ee\u9898\u4ee3\u7801\u4e2d\uff0c\u4ece\u670d\u52a1\u5668\u83b7\u53d6\u7684 html \u6570\u636e\u5f62\u5f0f\u5982\u4e0b\uff1a<\/p>\n<pre>&lt;html xmlns:x=\"urn:schemas-microsoft-com:office:excel\"&gt;\n  &lt;head&gt;\n    &lt;meta http-equiv=\"content-type\" content=\"application\/ms-excel; charset=gb2312\" \/&gt;\n    &lt;!-- [if gte mso 9]&gt;\n    &lt;xml&gt;\n      &lt;x:excelworkbook&gt;\n        &lt;x:excelworksheets&gt;\n          &lt;x:excelworksheet&gt;\n            &lt;x:name&gt;sheetname&lt;\/x:name&gt;\n            &lt;x:worksheetoptions&gt;\n              &lt;x:print&gt;\n                &lt;x:validprinterinfo \/&gt;\n              &lt;\/x:print&gt;\n            &lt;\/x:worksheetoptions&gt;\n          &lt;\/x:excelworksheet&gt;\n        &lt;\/x:excelworksheets&gt;\n      &lt;\/x:excelworkbook&gt;\n    &lt;\/xml&gt;\n    &lt;![endif]--&gt;&lt;!&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;table&gt;\n      &lt;tbody&gt;\n        &lt;tr&gt;\n          &lt;th&gt;\u4ea4\u6613\u65e5\u671f&lt;\/th&gt;\n          &lt;th&gt;\u603b\u8ba2\u5355\u6570&lt;\/th&gt;\n          &lt;th&gt;\u4ea4\u6613\u603b\u989d&lt;\/th&gt;\n          &lt;th&gt;\u5b8c\u6210\u8ba2\u5355\u6570&lt;\/th&gt;\n          &lt;th&gt;\u5b8c\u6210\u603b\u989d&lt;\/th&gt;\n          &lt;th&gt;\u64a4\u5355\u603b\u8ba2\u5355\u6570&lt;\/th&gt;\n          &lt;th&gt;\u64a4\u5355\u603b\u989d&lt;\/th&gt;\n        &lt;\/tr&gt;\n        &lt;tr&gt;\n          &lt;td&gt;2017-12-05&lt;\/td&gt;\n          &lt;td&gt;7414&lt;\/td&gt;\n          &lt;td&gt;1483.6&lt;\/td&gt;\n          &lt;td&gt;7414&lt;\/td&gt;\n          &lt;td&gt;1483.6&lt;\/td&gt;\n          &lt;td&gt;0&lt;\/td&gt;\n          &lt;td&gt;0&lt;\/td&gt;\n        &lt;\/tr&gt;\n      &lt;\/tbody&gt;\n    &lt;\/table&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<p>\u4e3a\u4e86\u5c06\u6b64 html \u7247\u6bb5\u63d2\u5165\u5230 iframe \u4e2d\uff0c\u4ee5\u4e0b\u6b65\u9aa4\u53ef\u80fd\u6709\u7528\uff1a<\/p>\n<ol>\n<li>\n<p>\u521b\u5efa iframe \u5143\u7d20\uff1a<\/p>\n<pre>&lt;iframe id=\"exceliframe\" style=\"width: 600px; height: 400px;\"&gt;&lt;\/iframe&gt;<\/pre>\n<\/li>\n<li>\n<p>\u4f7f\u7528 document.getelementbyid(&#8220;exceliframe&#8221;).contentwindow.document \u8bbf\u95ee iframe \u7684\u6587\u6863\u5bf9\u8c61\uff1a<\/p>\n<pre>const iframedocument = document.getelementbyid(\"exceliframe\").contentwindow.document;<\/pre>\n<\/li>\n<li>\n<p>\u7136\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 iframedocument.body.innerhtml = htmldata \u6765\u5c06\u83b7\u53d6\u7684 html \u6570\u636e\u63d2\u5165 iframe \u7684\u6b63\u6587\u4e2d\uff1a<\/p>\n<pre>iframeDocument.body.innerHTML = htmlData;<\/pre>\n<\/li>\n<\/ol>\n<p>\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u52a8\u6001\u751f\u6210\u7684 html \u8868\u683c\u5c06\u63d2\u5165\u5230 iframe \u4e2d\uff0c\u7528\u6237\u53ef\u4ee5\u5c06\u5176\u53e6\u5b58\u4e3a excel \u6587\u4ef6\u4ee5\u5b8c\u6210\u5bfc\u51fa\u64cd\u4f5c\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u672c\u6587\u7684\u5168\u90e8\u5185\u5bb9\u4e86\uff0c\u662f\u5426\u6709\u987a\u5229\u5e2e\u52a9\u4f60\u89e3\u51b3\u95ee\u9898\uff1f\u82e5\u662f\u80fd\u7ed9\u4f60\u5e26\u6765\u5b66\u4e60\u4e0a\u7684\u5e2e\u52a9\uff0c\u8bf7\u5927\u5bb6\u591a\u591a\u652f\u6301\u7c73\u4e91\uff01\u66f4\u591a\u5173\u4e8e\u6587\u7ae0\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u3002<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   \u534e\u4e3a\u624b\u673a\u600e\u4e48\u7528usb\u8fde\u63a5\u7535\u8111?\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5c06\u52a8\u6001\u751f\u6210\u7684 HTML \u8868\u683c\u63d2\u5165 iframe \u4ee5\u5b9e\u73b0\u5bfc\u51fa Excel \u529f\u80fd\uff1f \u77e5\u8bc6\u70b9\u638c\u63e1\u4e86\uff0c\u8fd8\u9700\u8981\u4e0d\u65ad\u7ec3\u4e60\u624d\u80fd\u719f\u7ec3\u8fd0\u7528\u3002\u4e0b\u9762\u7c73\u4e91\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u4e2a\u6587\u7ae0\u5f00\u53d1\u5b9e\u6218\uff0c\u624b\u628a\u624b\u6559\u5927\u5bb6\u5b66\u4e60\u300a\u5982\u4f55\u5c06\u52a8\u6001\u751f\u6210\u7684 HTML \u8868\u683c\u63d2\u5165 iframe \u4ee5\u5b9e\u73b0\u5bfc\u51fa Excel \u529f\u80fd\uff1f\u300b\uff0c\u5728\u5b9e\u73b0\u529f\u80fd\u7684\u8fc7\u7a0b\u4e2d\u4e5f\u5e26\u5927\u5bb6\u91cd\u65b0\u6e29\u4e60\u76f8\u5173\u77e5\u8bc6\u70b9\uff0c\u6e29\u6545\u800c\u77e5\u65b0\uff0c\u56de\u5934\u770b\u770b\u8bf4\u4e0d\u5b9a\u53c8\u6709\u4e0d\u4e00\u6837\u7684\u611f\u609f\uff01 \u5c06 html \u5143\u7d20\u52a8\u6001\u63d2\u5165 iframe \u672c\u6587\u8ba8\u8bba\u4e86\u5982\u4f55\u5728 iframe \u4e2d\u52a8\u6001\u63d2\u5165 html \u5143\u7d20\u4ee5\u6ee1\u8db3\u5c06\u8868\u8f6c\u6362\u6210 excel \u7684\u8981\u6c42\u3002 \u5728\u63d0\u4f9b\u7684\u95ee\u9898\u4ee3\u7801\u4e2d\uff0c\u4ece\u670d\u52a1\u5668\u83b7\u53d6\u7684 html \u6570\u636e\u5f62\u5f0f\u5982\u4e0b\uff1a &lt;html xmlns:x=&#8221;urn:schemas-microsoft-com:office:excel&#8221;&gt; &lt;head&gt; &lt;meta http-equiv=&#8221;content-type&#8221; content=&#8221;application\/ms-excel; charset=gb2312&#8243; \/&gt; &lt;!&#8211; [if gte mso 9]&gt; &lt;xml&gt; &lt;x:excelworkbook&gt; &lt;x:excelworksheets&gt; &lt;x:excelworksheet&gt; &lt;x:name&gt;sheetname&lt;\/x:name&gt; &lt;x:worksheetoptions&gt; &lt;x:print&gt; &lt;x:validprinterinfo \/&gt; &lt;\/x:print&gt; &lt;\/x:worksheetoptions&gt; &lt;\/x:excelworksheet&gt; &lt;\/x:excelworksheets&gt; &lt;\/x:excelworkbook&gt; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-53416","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=53416"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53416\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}