zoukankan      html  css  js  c++  java
  • 非常简单的数据,支持excel表格下载功能

    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <base href="<%=basePath%>">

    <title>My JSP 'MyJsp.jsp' starting page</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
    <script type="text/javascript" src="oa/js/jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="oa/js/jquery.js"></script>
    <script type="text/javascript" src="oa/js/jquery.table2excel.min.js"></script>

    </HEAD>

    <BODY>
    <input type="button" id="btn" value="导出到excel">
    <table class="table2excel">
    <tr >
    <td>111<td>
    <td>222<td>
    <td >333<td>
    </tr>
    <tr>
    <td>444<td>
    <td>555<td>
    <td >666<td>
    </tr>
    </table>
    </BODY>
    <script>
    $(function() {
    var d = new Date();
    var date = d.getFullYear() + "年" +(d.getMonth() + 1) + "月" + d.getDate() + "日";
    $("#btn").click(function(){
    $(".table2excel").table2excel({
    exclude: ".noExl",
    name: "Excel Document Name",
    filename: date,
    exclude_img: true,
    exclude_links: true,
    exclude_inputs: true
    });
    });

    });
    </script>
    </HTML>

  • 相关阅读:
    软件开发 —— 重构(refactor)
    语言与哲学 —— 维特根斯坦
    【撸码caffe 三】 caffe.cpp
    编程语言入门及进阶、设计模式、面向对象书籍
    用ISA2006配置单网卡缓存服务器
    Forefront TMG 之 ISP 冗余传输链路(ISP-R)
    MDT配置数据库
    MDT概念说明
    更改SQL实例端口
    SCCM2012安装、配置
  • 原文地址:https://www.cnblogs.com/zhangliang88/p/5470580.html
Copyright © 2011-2022 走看看