首页 > Web开发 > 详细

前端JS Excel导出

时间:2018-10-11 16:23:06      阅读:134      评论:0      收藏:0      [点我收藏+]

本文转载自:https://blog.csdn.net/plmzaqokn11/article/details/73604705

下载table2Excel插件

 

<input type="button" id="btn" value="导出" />
    <table id="example">
        <thead>
            <tr>
                <th>Column 1</th>
                <th>Column 2</th>
                <th>Column 3</th>
                <th>Column 4</th>
                <th>Column 5</th>
            </tr>
        </thead>
        <tbody>
            <tr>
            <td colspan="2">1aaa</td>
            <td>ccc</td>
            <td>ddd</td>
            <td>eee</td>
        </tr>
        <tr style="background-color:#0f0;">
            <td>3aaa</td>
            <td>34bbb</td>
            <td>ccc</td>
            <td>ddd</td>
            <td>修改</td>
        </tr>
        <tr>
            <td>22bbb</td>
            <td>22bbb</td>
            <td>ccc</td>
            <td>ddd</td>
            <td>eee</td>
        </tr>
        <tr>
            <td>5aaa</td>
            <td>55bbb</td>
            <td>ccc</td>
            <td>ddd</td>
            <td>eee</td>
        </tr>
        <tr>
            <td>4aaa</td>
            <td>44bbb</td>
            <td>ccc</td>
            <td>ddd</td>
            <td>eee</td>
        </tr>
        </tbody>
    </table>
$(function(){
        $("#btn").click(function(){
            $("#example").table2excel({
                // 不被导出的表格行的CSS class类
                exclude: ".noExl",
                // 导出的Excel文档的名称,(没看到作用)
                name: "Excel Document Name",
                // Excel文件的名称
                filename: "myExcelTable"
            });
        });
    });

 

前端JS Excel导出

原文:https://www.cnblogs.com/xinchenhui/p/9772932.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!