我生成这么一个表格,想在这个网页提供一个生成EXCEL表下载的功能,求高人指点!帮我改改谢谢!<table width="100%" class="sortable" cellspacing="0" border="1" cellpadding="0" align="center" id="table1">
<thead>
<tr align="center">
<th>设备类型</th>
<th>设备名称</th>
<th>国家编码</th>
<th>内部编码</th>
<th>设备价格</th>
<th>入库日期</th>
<th>编辑</th>
</tr>
</thead>
<c:forEach items="${equiments}" var="equi" >
<tr align="center" onmouseover="bgColor='FDE432'" onmouseout="bgColor='#ffffff'" > <td >${equi.types}</td>
<td >${equi.equiName}</td>
<td >${equi.equiCode}</td>
<td >${equi.innerCode}</td>
<td >${equi.equiPrice}</td>
<td >${equi.buyDate}</td>
<td>
<html:link page="/equiment.do?method=delEquiment&ID=${equi.ID}">
<bean:message key="lable.delEqui"/>
</html:link>
<html:link page="/equiment.do?method=repairEqui&ID=${equi.ID}">
<bean:message key="lable.repairEqui"/>
</html:link>
<html:link page="/updateEqui.do?method=loadEqui&ID=${equi.ID}">
<bean:message key="lable.updateEqui"/>
</html:link>
</td>
</tr>
</c:forEach>
</table>
<thead>
<tr align="center">
<th>设备类型</th>
<th>设备名称</th>
<th>国家编码</th>
<th>内部编码</th>
<th>设备价格</th>
<th>入库日期</th>
<th>编辑</th>
</tr>
</thead>
<c:forEach items="${equiments}" var="equi" >
<tr align="center" onmouseover="bgColor='FDE432'" onmouseout="bgColor='#ffffff'" > <td >${equi.types}</td>
<td >${equi.equiName}</td>
<td >${equi.equiCode}</td>
<td >${equi.innerCode}</td>
<td >${equi.equiPrice}</td>
<td >${equi.buyDate}</td>
<td>
<html:link page="/equiment.do?method=delEquiment&ID=${equi.ID}">
<bean:message key="lable.delEqui"/>
</html:link>
<html:link page="/equiment.do?method=repairEqui&ID=${equi.ID}">
<bean:message key="lable.repairEqui"/>
</html:link>
<html:link page="/updateEqui.do?method=loadEqui&ID=${equi.ID}">
<bean:message key="lable.updateEqui"/>
</html:link>
</td>
</tr>
</c:forEach>
</table>
解决方案 »
- java下拉列表方面的求大侠指教
- 按钮调用js提交值到表单的问题
- 100分求在Eclipse中查找文件的正则表达式。
- struts乱码问题----请高手赐教
- MySql数据库连接没有遇到这种情况。请指点
- 关于使用JSTL的问题?
- 如何令访问http://127.0.0.1:8080/testServlet/myServlet?test=1等同于访问http://127.0.0.1:8080/testServlet/myServlet?
- 求助:关于建立聊天室的问题,求助资料!!!!!!
- apache安装后为什么一点反映都没有?
- 取不到生成的SELECT值?
- date格式问题
- eclipse+struts2运行问题
function exportExcel(tableid){
if (typeof(EXPORT_OBJECT)!="object"){
document.body.insertAdjacentHTML("afterBegin","<OBJECT style='display:none' classid=clsid:0002E510-0000-0000-C000-000000000046 id=EXPORT_OBJECT></Object>");
}
with (EXPORT_OBJECT){
DataType = "HTMLData";
HTMLData =tableid.outerHTML;
try{
ActiveSheet.Export("C:\\表格.xls", 0);
alert('成功导出EXCEL表格!');
}
catch (e){
alert('导出EXCEL表格失败,请确定已安装Excel2000(或更高版本),并且没打开同名xls文件');
}
}
}
</script>
你顺便教我怎么调用把,我不会javascript