我想在我的 html 页面中显示来自 excel 工作表的表格。一个excel表中有多个表。我想显示一个特定的表格。请帮忙..
我用来从 excel 文件中提取信息的 HTML 代码
<html>
<head>
<title>
From Excel
</title>
<script language="javascript" >
function GetData(cell,row){
var excel = new ActiveXObject("Excel.Application");
var excel_file = excel.Workbooks.Open("C:\\abc.xlsx");
var excel_sheet = excel.Worksheets("25 PEs");
var data = excel_sheet.Cells(cell,row).Value;
document.getElementById('div1').innerText =data;
}
</script>
</head>
<body>
<div id="div1" style="background: #DFDFFF; width:'100%';" align="center">
Click buttons to fetch data from c:\abc.xlsx
</div>
<input name="Button1" type="button" onClick="GetData(1,1)" value="button1">
<input name="Button2" type="button" onClick="GetData(1,2)" value="button2">
<input name="Button3" type="button" onClick="GetData(2,1)" value="button3">
<input name="Button4" type="button" onClick="GetData(2,2)" value="button4">
</body>
</html>
此代码一次提取一个单元格。我想一次提取整个表。怎么做?