想在網(wǎng)站上展示 Excel 數(shù)據(jù)時(shí),將Excel 轉(zhuǎn)換為 HTML 是最佳選擇。Excel 非常適合組織數(shù)據(jù),而 HTML 表格則非常適合網(wǎng)頁(yè)。因此,我們將在本篇文章中講解如何將 Excel 電子表格轉(zhuǎn)換為 HTML 表格,此外,我們還將討論具有內(nèi)置人工智能功能的轉(zhuǎn)換器工具。
市面上有兩種可以信賴(lài)的流行工具,包括 UPDF PDF 編輯器和 MS Excel,這兩種工具都為 Windows 和 Mac 平臺(tái)上的用戶(hù)提供了有效的轉(zhuǎn)換功能。我們?cè)谙旅娓敿?xì)地解釋了這些工具。
方式 1. 通過(guò) UPDF 將 Excel 導(dǎo)出為 HTML
UPDF是將 Excel 導(dǎo)出為 HTML 的首選,因?yàn)樗浅?煽?,不僅可以轉(zhuǎn)換 PDF,還可以轉(zhuǎn)換各種其他文件類(lèi)型,包括 Excel 到 HTML。
UPDF 的突出功能之一是它能夠保持原始文檔的質(zhì)量和格式。它甚至能夠識(shí)別掃描文檔, 即用OCR 功能將文檔轉(zhuǎn)換為可編輯文本。用它將 Excel 轉(zhuǎn)換為 HTML 文件的步驟如下:
第1步:打開(kāi)UPDF工具并創(chuàng)建PDF
首先,啟動(dòng) UPDF 程序,然后,在左上角找到“文件”選項(xiàng)卡并單擊它。然后,向下移動(dòng)到“創(chuàng)建”選項(xiàng)并將光標(biāo)置于打開(kāi)“創(chuàng)建”選項(xiàng)。從列表中選擇“從Excel 創(chuàng)建 PDF”,找到電子表格并將其打開(kāi)。
第 2 步:導(dǎo)出轉(zhuǎn)換后的電子表格并保存
導(dǎo)入 Excel 文件后它將轉(zhuǎn)換為 PDF 格式。然后,前往右側(cè)面板并點(diǎn)擊“導(dǎo)出 PDF”按鈕。接下來(lái),從提供的列表中選擇“HTML”,然后根據(jù)需要繼續(xù)自定義“文檔語(yǔ)言”、“頁(yè)面范圍”和文本識(shí)別設(shè)置。最后,按“導(dǎo)出”按鈕將轉(zhuǎn)換后的 HTML 文件存儲(chǔ)在 Windows 或 Mac 上。
方式 2. 通過(guò) Microsoft Excel 將 Excel 轉(zhuǎn)換為HTML
使用 Microsoft Excel 將 Excel轉(zhuǎn)換為 HTML 非常方便,只需幾個(gè)簡(jiǎn)單的步驟,并且這個(gè)方法會(huì)保留電子表格的結(jié)構(gòu)、格式和公式,其他人可以輕松查看數(shù)據(jù)并與之交互。請(qǐng)按照以下步驟進(jìn)行簡(jiǎn)單的 Excel 到 HTML 轉(zhuǎn)換:
第 1 步:使用 MS Excel 打開(kāi)文件
首先,在 Windows 或 Mac 上瀏覽所需的電子表格,然后使用 MS Excel 打開(kāi)它。接下來(lái),點(diǎn)擊 Excel 界面左上角的“文件”選項(xiàng)卡,從給定的選項(xiàng)中選擇“另存為”,然后雙擊“此電腦”選項(xiàng)。
第 2 步:另存文件
上述步驟將打開(kāi)“另存為”對(duì)話框,輸入所需的“文件名”,然后從“另存為類(lèi)型”下拉列表中選擇“HTML”,然后點(diǎn)擊對(duì)話框中的“保存”按鈕。
這個(gè)方法可以很好地快速且高效地在線將 Excel 導(dǎo)出為 HTML,將用到Convertio 和 Zamzar 兩個(gè)頂級(jí)的免費(fèi)工具。
方式 1. 通過(guò) Convertio 免費(fèi)在線將 Excel 導(dǎo)出為 HTML
Convertio 是一個(gè)超級(jí)簡(jiǎn)單的在線工具,可以幫助轉(zhuǎn)換不同類(lèi)型的文件,可以輕松轉(zhuǎn)換文檔、圖像、視頻、音頻文件和電子書(shū),而且不需要下載或安裝任何東西。讓我們看一下在線將 Excel 轉(zhuǎn)換為 HTML 的簡(jiǎn)單步驟:
第 1 步: 在網(wǎng)絡(luò)瀏覽器中訪問(wèn) Convertio 的網(wǎng)站
在頂部欄中查找“轉(zhuǎn)換”選項(xiàng)并單擊它,會(huì)出現(xiàn)具有擴(kuò)展功能的菜單,從列表中選擇“文檔轉(zhuǎn)換器”。
第 2 步: 導(dǎo)入 Excel 電子表格
有兩種選擇:使用文件資源管理器從電腦上傳或直接從 Google Drive 或 Dropbox 導(dǎo)入。導(dǎo)入 Excel 文件后,找到“收件人”選項(xiàng)旁邊的下拉菜單,單擊它并從“文檔”旁邊的可用轉(zhuǎn)換格式中選擇“HTML”。
第 3 步: 選擇所需的輸出格式后,單擊“轉(zhuǎn)換”選項(xiàng)
單擊后轉(zhuǎn)換過(guò)程開(kāi)始,完成后將看到“下載”按鈕,只需單擊它即可將轉(zhuǎn)換后的 HTML 文件保存到電腦。
方法 2. 通過(guò) Zamzar 在線將 Excel 轉(zhuǎn)換為 HTML
Zamzar 是一款我強(qiáng)烈推薦的在線工具,它可以輕松地將 Excel 轉(zhuǎn)換為HTML。由于其簡(jiǎn)約易上手的界面,Zamzar 是滿(mǎn)足所有文件轉(zhuǎn)換需求的首選,且這個(gè)軟件無(wú)需注冊(cè)就能使用。但它也存在一些限制,允許轉(zhuǎn)換的最大文件大小為 2GB,支持最多 25 個(gè)文件批量轉(zhuǎn)換。現(xiàn)在,讓我們深入研究下面提到的將 Excel 轉(zhuǎn)換為 HTML 的簡(jiǎn)單步驟:
第 1 步:打開(kāi)計(jì)算機(jī)的網(wǎng)絡(luò)瀏覽器并導(dǎo)航至 Zamzar 的網(wǎng)站
找到“選擇文件”按鈕并按下。然后,可以從計(jì)算機(jī)中選擇所需的 Excel 文件。但是,將文件拖放到指定區(qū)域會(huì)更加方便。
第 2 步: Excel 文件成功上傳后,選擇輸出格式
選擇“HTML”作為轉(zhuǎn)換格式,單擊“立即轉(zhuǎn)換”按鈕,Zamzar 將開(kāi)始轉(zhuǎn)換過(guò)程。轉(zhuǎn)換完成后,將出現(xiàn)“下載”按鈕,單擊它即可開(kāi)始下載轉(zhuǎn)換后的 HTML 文件。
這篇文章我們講了幾種工具來(lái)快速、輕松地將 Excel 轉(zhuǎn)換為 HTML,幾種工具對(duì)比下來(lái),我們強(qiáng)烈推薦 UPDF 編輯器,它能夠?qū)?Excel 轉(zhuǎn)換為 HTML,并提供強(qiáng)大的 AI 功能,讓用戶(hù)可以方便快捷地查查詢(xún)自己想要的操作步驟。
信我或關(guān)注微信號(hào):獅范兒,回復(fù):學(xué)習(xí),獲取免費(fèi)學(xué)習(xí)資源包。
Excel文件轉(zhuǎn)成html頁(yè)面代碼
main類(lèi):?jiǎn)?dòng)類(lèi)
package com.test; import trans.toHtml; public class testToHtml { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub toHtml th=new toHtml(); // System.out.println(System.getProperty("java.library.path")); //-Djava.library.path=D:\jar\jacob_1.9 th.excelToHtml("d:/excel/運(yùn)維門(mén)戶(hù)通訊錄.xlsx", "d:/test.html"); } }
代碼:
package trans; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import com.jacob.activeX.ActiveXComponent; import com.jacob.com.Dispatch; import com.jacob.com.Variant; public class toHtml { int WORD_HTML=8; int WORD_TXT=7; int EXCEL_HTML=44; /** * WORD?HTML * @param docfile WORD ? ?· * @param htmlfile ? HTML · */ public void wordToHtml(String docfile, String htmlfile) { ActiveXComponent app=new ActiveXComponent("Word.Application"); // word try { app.setProperty("Visible", new Variant(false)); Dispatch docs=app.getProperty("Documents").toDispatch(); Dispatch doc=Dispatch.invoke(docs,"Open",Dispatch.Method,new Object[] { docfile, new Variant(false),new Variant(true) }, new int[1]).toDispatch(); Dispatch.invoke(doc, "SaveAs", Dispatch.Method, new Object[] {htmlfile, new Variant(WORD_HTML) }, new int[1]); Variant f=new Variant(false); Dispatch.call(doc, "Close", f); } catch (Exception e) { e.printStackTrace(); } finally { app.invoke("Quit", new Variant[] {}); } } /** * EXCEL?HTML * @param xlsfile EXCEL ? ?· * @param htmlfile ? HTML · */ public void excelToHtml(String xlsfile, String htmlfile) { ActiveXComponent app=new ActiveXComponent("Excel.Application"); // excel try { app.setProperty("Visible", new Variant(false)); Dispatch excels=app.getProperty("Workbooks").toDispatch(); Dispatch excel=Dispatch.invoke(excels,"Open",Dispatch.Method,new Object[] { xlsfile, new Variant(false),new Variant(true) }, new int[1]).toDispatch(); Dispatch.invoke(excel, "SaveAs", Dispatch.Method, new Object[] {htmlfile, new Variant(EXCEL_HTML) }, new int[1]); Variant f=new Variant(false); Dispatch.call(excel, "Close", f); } catch (Exception e) { e.printStackTrace(); } finally { app.invoke("Quit", new Variant[] {}); } } /** * /? ? * @param folderPath ? ?· * @param htmlfile ? HTML · */ public void delFolder(String folderPath) { try { delAllFile(folderPath); //? String filePath=folderPath; filePath=filePath.toString(); java.io.File myFilePath=new java.io.File(filePath); myFilePath.delete(); //? ? } catch (Exception e) {e.printStackTrace();} } /** * /? ? ? * @param path ? ?· */ public boolean delAllFile(String path) { boolean flag=false; File file=new File(path); if (!file.exists()) { return flag; } if (!file.isDirectory()) { return flag; } String[] tempList=file.list(); File temp=null; for (int i=0; i < tempList.length; i++) { if (path.endsWith(File.separator)) { temp=new File(path + tempList[i]); } else { temp=new File(path + File.separator + tempList[i]); } if (temp.isFile()) { temp.delete(); } if (temp.isDirectory()) { delAllFile(path + "/" + tempList[i]);// ? ? ? delFolder(path + "/" + tempList[i]);// ? ? flag=true; } } return flag; } } 需要的jar包 <<jacob.jar>> <<toHtml.java>> <<testToHtml.java>>
來(lái)源網(wǎng)絡(luò),侵權(quán)聯(lián)系刪除
私信我或關(guān)注微信號(hào):獅范兒,回復(fù):學(xué)習(xí),獲取免費(fèi)學(xué)習(xí)資源包。
在HTML/CSS 中,我們經(jīng)常用HTML來(lái)布局和填充內(nèi)容,用CSS來(lái)添加效果,修飾內(nèi)容和布局,使整個(gè)頁(yè)面變得更好看。
即在<head></head>標(biāo)簽內(nèi)添加CSS樣式表的鏈接:
代碼展示如下:
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Make a Table Frame</title> <link rel="stylesheet" type="text/css" href="CSS/tableframe.css" > </head>
定義:
對(duì)帶有指定屬性的 HTML 元素設(shè)置樣式。
注意:
只有在規(guī)定了 !DOCTYPE 時(shí),IE7 和 IE8 才支持屬性選擇器。在 IE6 及更低的版本中,不支持屬性選擇。
功能:
“選擇器”指明了{(lán)}中的“樣式”的作用對(duì)象,也就是“樣式”作用于網(wǎng)頁(yè)中的哪些元素。
CSS中的選擇器有三個(gè):
標(biāo)簽選擇器、class類(lèi)選擇器、id選擇器
1.標(biāo)簽選擇器樣式表:a{}、 div{}、table{} ...
{對(duì)全局所有的選中類(lèi)型標(biāo)簽的樣式修改}
2.class類(lèi)選擇器 樣式表: .class{}
{在HTML中每個(gè)標(biāo)簽都可以同時(shí)綁定多個(gè)類(lèi)名,每個(gè)標(biāo)簽都可以設(shè)置class;同一個(gè)界面中class是不可重復(fù)}
3. id選擇器樣式表: #d1 {}
{每個(gè)標(biāo)簽都可有id,每個(gè)頁(yè)面不可重復(fù)id,}
【一個(gè)HTML標(biāo)簽只能綁定一個(gè)id屬性,一個(gè)HTML標(biāo)簽可以綁定多個(gè)class屬性】
單純選擇<div>標(biāo)簽的時(shí)候 是對(duì)全局的的(所有的)<div>進(jìn)行修飾;
選擇器優(yōu)先級(jí):
id選擇器>class類(lèi)選擇器>標(biāo)簽選擇器
所以有id和class 選擇器的標(biāo)簽將不會(huì)被覆蓋。交叉時(shí)是按照優(yōu)先級(jí)覆蓋顯示的。
單純的HTML 表格表單內(nèi)容
標(biāo)題<caption>標(biāo)簽:
表格的標(biāo)題<caption>的內(nèi)容填充(HTML):
<caption> 表格標(biāo)題</caption>
標(biāo)題<caption>的樣式修飾(CSS)
table.formdata caption { text-shadow: #FF00ff; text-align: center; padding-bottom: 6px; font-weight: bold; }
其他<table>標(biāo)簽相關(guān)內(nèi)容可參考 HTML中表格的實(shí)例應(yīng)用 一文。
form在網(wǎng)頁(yè)中主要負(fù)責(zé)數(shù)據(jù)采集功能。
一個(gè)表單有三個(gè)基本組成部分:
(1)表單標(biāo)簽:包含了處理表單數(shù)據(jù)所用CGI程序的URL以及數(shù)據(jù)提交到服務(wù)器的方法。
(2)表單域:包含了文本框、密碼框、隱藏域、多行文本框、復(fù)選框、單選框、下拉選擇框和文件上傳框等。
(3)表單按鈕:提交按鈕、復(fù)位按鈕和一般按鈕;用于將數(shù)據(jù)傳送到服務(wù)器上的CGI腳本或者取消輸入。還可以用表單按鈕來(lái)控制其他定義了處理腳本的處理工作。
定義:
<input> 標(biāo)簽規(guī)定用戶(hù)可輸入數(shù)據(jù)的輸入字段。
根據(jù)不同的 type 屬性,輸入字段有多種形態(tài)。輸入字段可以是文本字段、復(fù)選框、密碼字段、單選按鈕、按鈕等等
語(yǔ)法代碼:
<input type="value" >
實(shí)例代碼:
<td><input type="text" name="Mainboard 6月" id="Mainboard 6月"></td>
關(guān)系展示:
實(shí)例代碼:
<p>
<input type="submit" name="btnSubmit" id="btnSubmit" value="Add Data" class="btn">
<input type="reset" value="Reset All" class="btn">
</p>
實(shí)例展示:
<input>標(biāo)簽的其他屬性值:
input標(biāo)簽外是否添加form標(biāo)簽需要按情形區(qū)分:
應(yīng)用場(chǎng)景的區(qū)別:
1.所有向后臺(tái)提交數(shù)據(jù)(包括原生和ajax提交)的<input>都建議用<form>包裹.
2.如果只是用來(lái)做前臺(tái)交互效果則不推薦使用form包裹。
但提交數(shù)據(jù)時(shí),其實(shí)也可以不用form包裹input標(biāo)簽:
1.如果有form標(biāo)簽,在點(diǎn)擊提交銨鈕時(shí),瀏覽器自動(dòng)收集參數(shù),并打包一個(gè)http請(qǐng)求到服務(wù)器,完成表單提交。在這一過(guò)程中,瀏覽器會(huì)根據(jù)method的不同,將參數(shù)編碼后,放在urI中(get),或者放在請(qǐng)求的data中(post)。然后發(fā)送到服務(wù)器。
2.如果沒(méi)有form,post方式的提交要使用ajax手工完成。get方式的提交需要自己拼接url。
<form>表單其他相關(guān)內(nèi)容可參考 HTML中 表單 的應(yīng)用實(shí)例 一文。
最后,附帶一下該可輸入的EXCEL表格的源碼。
HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Make a Table Frame</title> <link rel="stylesheet" type="text/css" href="CSS/tableframe.css" > </head> <body image=""> <form method="psot"> <table border="1px" class="formdata"> <caption>電腦配件管理表2018年5月-8月</caption> <tr> <th></th> <th scope="col">5月</th> <th scope="col">6月</th> <th scope="col">7月</th> <th scope="col">8月</th> </tr> <tr> <th scope="row">Hard Disk</th> <td><input type="text" name="Hard Disk 5月" id="Hard Disk 5月"></td> <td><input type="text" name="Hard Disk 6月" id="Hard Disk 6月"></td> <td><input type="text" name="Hard Disk 7月" id="Hard Disk 7月"></td> <td><input type="text" name="Hard Disk 8月" id="Hard Disk 8月"></td> </tr> <tr> <th scope="row">Mainboard</th> <td><input type="text" name="Mainboard 5月" id="Mainboard 5月"></td> <td><input type="text" name="Mainboard 6月" id="Mainboard 6月"></td> <td><input type="text" name="Mainboard 7月" id="Mainboard 7月"></td> <td><input type="text" name="Mainboard 8月" id="Mainboard 8月"></td> </tr> <tr> <th scope="row">Case</th> <td><input type="text" name="Case 5月" id="Case 5月"></td> <td><input type="text" name="Case 6月" id="Case 6月"></td> <td><input type="text" name="Case 7月" id="Case 7月"></td> <td><input type="text" name="Case 8月" id="Case 8月"></td> </tr> <tr> <th scope="row">Power</th> <td><input type="text" name="Power 5月" id="Power 5月"></td> <td><input type="text" name="Power 6月" id="Power 6月"></td> <td><input type="text" name="Power 7月" id="Power 7月"></td> <td><input type="text" name="Power 8月" id="Power 8月"></td> </tr> <tr> <th scope="row">CPU Fan</th> <td><input type="text" name="CPU Fan 5月" id="CPU Fan 5月"></td> <td><input type="text" name="CPU Fan 6月" id="CPU Fan 6月"></td> <td><input type="text" name="CPU Fan 7月" id="CPU Fan 7月"></td> <td><input type="text" name="CPU Fan 8月" id="CPU Fan 8月"></td> </tr> <tr> <th scope="row">Total</th> <td><input type="text" name="Total 5月" id="Total 5月"></td> <td><input type="text" name="Total 6月" id="Total 6月"></td> <td><input type="text" name="Total7月" id="Total 7月"></td> <td><input type="text" name="Total 8月" id="Total 8月"></td> </tr> </table> <p> <input type="submit" name="btnSubmit" id="btnSubmit" value="Add Data" class="btn"> <input type="reset" value="Reset All" class="btn"> </p> </form> </body> </html>
CSS code :
body { font-family: Arial; /*background-image: url(image/mainroad.jpg) no-repeat;*/ background-color: #00ff00; background-size: 100%; } table.formdata { width: 300px; height: 150px; border: 2px solid #F00; border-collapse: collapse; font-family: Arial; } table.formdata caption { text-shadow: #FF00ff; text-align: center; padding-bottom: 6px; font-weight: bold; } table.formdata th { border:1px solid #be34hc; background-color: #E2E2E2; color:#000000; text-aglin:center; font-weight: normal; padding: 2px 8px 2px 6px; margin: 0px; } table.formdata input { width: 100px; padding: 1px 3px 1px 3px; margin: 0px; border:none; font-family: Arial; } .btn { width:100px; background-color: #FF00ee; border:1px solid #00f2f2; font-family: Arial; }
本文部分內(nèi)容來(lái)自網(wǎng)絡(luò),如有侵權(quán),請(qǐng)聯(lián)系修改。
*請(qǐng)認(rèn)真填寫(xiě)需求信息,我們會(huì)在24小時(shí)內(nèi)與您取得聯(lián)系。