Kích thước tập tin. 51 KBTổng số lượt xem. 599209Cập nhật lần cuối. 06/04/2019 00. 35. 00 UTC Ngày Xuất bản. 18/11/2014 05. 52. 56 UTCTrang web chính thức. Tới trang webGiấy phép. MIT Tải xuống bản trình diễn Thêm trong danh mục này Xem các plugin được đề xuất TOP 100 Plugin jQuery 2022 Chrome, IE8+, FireFox, Opera, Safari#excel#xuất bảng#Bảng tính table2excel là một plugin jQuery đơn giản nhưng hữu ích cho phép xuất dữ liệu bảng Html sang tệp Excel plugin thay thế
Xem thêm
Làm thế nào để sử dụng nó1. Bao gồm thư viện jQuery và plugin jQuery table2excel trong tài liệu Html <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="src/jquery.table2excel.js"></script> 2. Tạo nút 'Xuất' để xuất dữ liệu bảng sang tệp Excel theo cách thủ công. Không bắt buộc <button>Export</button> 3. Gọi plugin trên bàn và vượt qua các tùy chọn sau $("button").click(function(){ $("#table2excel").table2excel({ // exclude CSS class exclude: ".noExl", name: "Worksheet Name", filename: "SomeFile", //do not include extension fileext: ".xls" // file extension }); }); 4. Sau đó, bạn có thể thêm lớp CSS 'noExl' vào bất kỳ thẻ <tr class="noExl"> <th>#</th> <th>Column heading</th> <th>Column heading</th> <th>Column heading</th> </tr> 5. Xác định xem có giữ nguyên màu nền và phông chữ không. Mặc định. sai $("#table2excel").table2excel({ exclude: ".noExl", name: "Worksheet Name", filename: "SomeFile", fileext: ".xls", preserveColors: true }); 6. Xác định xem có loại trừ hình ảnh, liên kết và trường nhập liệu hay không. Mặc định. thật $("#table2excel").table2excel({ exclude: ".noExl", name: "Worksheet Name", filename: "SomeFile", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); Nhật ký thay đổi2019-06-04
2019-02-07
2017-05-26
2016-03-08
2015-05-22
2015-04-08
2015-04-04
Plugin jQuery tuyệt vời này được phát triển bởi Rainabba. Để biết thêm Cách sử dụng nâng cao, vui lòng kiểm tra trang demo hoặc truy cập trang web chính thức Trong quá trình thiết kế và phát triển web, thực hiện sao lưu thường xuyên là một thực hành quan trọng được tuân theo. jQuery cung cấp plugin table2excel giúp xuất bảng HTML sang excel (. tệp xls) Vui lòng tải xuống các tệp thư viện cần thiết từ plugin jQuery table2excel và đưa nó vào thư mục làm việc của bạn như trong các ví dụ sau Liên kết tải xuống. https. //github. com/rainabba/jquery-table2excel ví dụ 1. Ví dụ sau minh họa chức năng rất cơ bản của plugin table2excel. Nội dung của bảng cùng với các tiêu đề được xuất sang “GFGFile. tập tin xls”
<button>Export</button>0 <button>Export</button>1 < <button>Export</button>3 <button>Export</button>0 <button>Export</button>5 < < 0< 1< 0<button>Export</button>0 <button>Export</button>5 < < 6 < 7< 8
<button>Export</button>0 <button>Export</button>5 html 2< 6<button>Export</button>0 <button>Export</button>5 < < 6 < 7< 8<button>Export</button>00 <button>Export</button>01 < 6<button>Export</button>0 _______11____92____13 <button>Export</button>0 <button>Export</button>1 < <button>Export</button>10 <button>Export</button>0 <button>Export</button>5 < <button>Export</button>14 <button>Export</button>15 < 8<button>Export</button>17 <button>Export</button>18 <button>Export</button>14 <button>Export</button>0 <button>Export</button>5 < < 3< 4< 3<button>Export</button>0 <button>Export</button>5 < < 9<button>Export</button>01 < 9<button>Export</button>0 <button>Export</button>5 < <button>Export</button>35 <button>Export</button>36 < 8<button>Export</button>38 <button>Export</button>39 < 8<button>Export</button>01 <button>Export</button>0 ________ 103 ________ 8 ________ 105 ________ 10 <button>Export</button>07 < <button>Export</button>09 <button>Export</button>50 <button>Export</button>09 <button>Export</button>0 <button>Export</button>07 < <button>Export</button>09 <button>Export</button>56 <button>Export</button>09 <button>Export</button>0 <button>Export</button>07 < <button>Export</button>09 < 2<button>Export</button>09 <button>Export</button>0 ________ 103 ________ 92 ________ 105 ________ 10 ________ 89 ________ 8 ________ 105 ________ 10
<button>Export</button>0
<button>Export</button>0
<button>Export</button>0 ________ 89 ________ 92 ________ 105 ________ 10 ________ 89 ________ 8 ________ 105 ________ 10
<button>Export</button>0
<button>Export</button>0
<button>Export</button>0 ________ 89 ________ 92 ________ 105 ________ 10 ________ 89 ________ 8 ________ 105 ________ 10
<button>Export</button>0
<button>Export</button>0
<button>Export</button>0 ________ 89 ________ 92 ________ 105 ________ 10 ________ 89 ________ 8 ________ 105 ________ 10
<button>Export</button>0
<button>Export</button>0
<button>Export</button>0 ________ 89 ________ 92 ________ 105 ________ 10 ________ 89 ________ 8 ________ 105 ________ 10
<button>Export</button>0
<button>Export</button>0
<button>Export</button>0 ________ 89 ________ 92 ________ 105 ________ 10 ________ 89 ________ 8 ________ 105 ________ 10
<button>Export</button>0
<button>Export</button>0
<button>Export</button>0 ________ 89 ________ 92 ________ 105 ________ 10 <button>Export</button>5 html 2<button>Export</button>35 html 58
<button>Export</button>5 < < 6<button>Export</button>0 <button>Export</button>03____965
<button>Export</button>1____977
<button>Export</button>03 html 85<button>Export</button>5 html 2< 6<button>Export</button>0 _______11____92____110 <button>Export</button>0
<button>Export</button>0 đầu ra
ví dụ 2. Trong ví dụ sau, plugin table2excel được giải thích cùng với việc hiển thị thêm cài đặt tùy chọn. Trong cấu trúc HTML, hai bảng được lấy để hiển thị các kết quả khác nhau trong tệp xuất. Các tiêu đề hàng 1 của bảng không được xuất trong các tệp excel đầu ra vì chúng đã được gán lớp “noExl” như trong chương trình bên dưới. Bảng 2 được gán với lớp “colorClass” để các màu được gán cho bất kỳ điều khiển HTML nào được giữ nguyên như được hiển thị trong mã. Người lập trình có thể thiết lập các tùy chọn tùy theo yêu cầu của ứng dụng
<button>Export</button>0 <button>Export</button>1 < <button>Export</button>3 <button>Export</button>0 <button>Export</button>5 < < 0< 1< 0<button>Export</button>0 <button>Export</button>5 < < 6 < 7< 8
<button>Export</button>0 <button>Export</button>5 html 2< 6<button>Export</button>0 <button>Export</button>5 < < 6 < 7< 8<button>Export</button>00 <button>Export</button>01 < 6<button>Export</button>0 _______11____92____13 <button>Export</button>0 <button>Export</button>1 < <button>Export</button>10 <button>Export</button>0 <button>Export</button>5 < <button>Export</button>14 <button>Export</button>15 < 8<button>Export</button>17 <button>Export</button>18 <button>Export</button>14 <button>Export</button>0 <button>Export</button>5 < < 3< 4< 3<button>Export</button>0 <button>Export</button>5 < < 9<button>Export</button>01 < 9<button>Export</button>0 <button>Export</button>5 < <button>Export</button>35 <button>Export</button>39 < 8<button>Export</button>01 <button>Export</button>0 ________ 103 ________ 8 ________ 1069 ________ 10
<button>Export</button>05 <button>Export</button>39 < 8<button>Export</button>076 <button>Export</button>0
<button>Export</button>0 ________ 1082 ________ 1083 ________ 805 ________ 10 <button>Export</button>086 < < 05<button>Export</button>089
<button>Export</button>0 ________ 89 ________ 92 ________ 105 ________ 10
<button>Export</button>05 <button>Export</button>101 < 05<button>Export</button>103 < 05<button>Export</button>0 <button>Export</button>106 < < 05<button>Export</button>109 < 05<button>Export</button>01 <button>Export</button>05 <button>Export</button>0 ________ 103 ________ 92 ________ 1069 ________ 10 <button>Export</button>03 < <button>Export</button>120 <button>Export</button>0
<button>Export</button>05 <button>Export</button>101 < 05<button>Export</button>127 < 05<button>Export</button>0
<button>Export</button>133 < 05<button>Export</button>01 <button>Export</button>05 <button>Export</button>0
<button>Export</button>05 <button>Export</button>101 < 05<button>Export</button>144 < 05<button>Export</button>0
<button>Export</button>150 < 05<button>Export</button>01 <button>Export</button>05 <button>Export</button>0 <button>Export</button>03 html 2____1120<button>Export</button>0 <button>Export</button>03 < <button>Export</button>161 <button>Export</button>0
<button>Export</button>05_______1101 < 05 <button>Export</button>168______88 <button>Export</button>170 <button>Export</button>171 < 05<button>Export</button>01 <button>Export</button>05 <button>Export</button>0 <button>Export</button>03 html 2____1161<button>Export</button>0 <button>Export</button>5 html 2<button>Export</button>35 <button>Export</button>0 <button>Export</button>5 < <button>Export</button>186 <button>Export</button>39 < 8<button>Export</button>189 <button>Export</button>190 <button>Export</button>186 <button>Export</button>101 < 9<button>Export</button>01 < 9<button>Export</button>0 |