Jquery table2excel nhiều bảng

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

Jquery table2excel nhiều bảng

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ế

  • Xuất dữ liệu bảng & JSON sang Excel bằng jQuery - ExportToExcel
  • Xuất bảng Html sang CSV/XLS/XLSX/Văn bản - jQuery TableExport
  • Trình chuyển đổi bảng HTML sang Excel – saveAsExcel. js
  • Bảng phía máy khách sang plugin xuất Excel - jQuery ExcelGen

Xem thêm

  • Chuyển đổi tệp CSV thành bảng dữ liệu
  • Tạo bảng từ tệp CSV - Trình phân tích cú pháp CSV
  • Trình chuyển đổi dữ liệu CSV sang JSON với jQuery
  • Trình chuyển đổi CSV sang bảng – CsvToTable. js
  • Xuất dữ liệu JSON sang tệp CSV – CSV-Export

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 nào để bỏ qua dữ liệu bảng đã chỉ định trong khi xuất

<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 đổi

2019-06-04

  • Đã thêm hỗ trợ cho màu nền và màu phông chữ trong hàng và cột

2019-02-07

  • v1. 1. 2. Cập nhật jquery. bảng2excel. js

2017-05-26

  • v1. 1. 1. Cập nhật jquery. bảng2excel. js

2016-03-08

  • Hỗ trợ unicode và tính năng mở rộng tập tin

2015-05-22

  • Cập nhật jquery. bảng2excel. js

2015-04-08

  • Đã thêm hỗ trợ IE11

2015-04-04

  • Các thay đổi được thực hiện để chuyển sang hỗ trợ nhiều bảng cho một tệp Excel

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”




<!DOCTYPE html>

<____9

<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

<9

<button>Export</button>
0

<button>Export</button>
5html2<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

<03<<05<06<05

<button>Export</button>
0

<03<<05<12<05

<button>Export</button>
0

<03<<05<18<05

<button>Export</button>
0

________ 89 ________ 92 ________ 105 ________ 10

________ 89 ________ 8 ________ 105 ________ 10

<03<<05<32<05

<button>Export</button>
0

<03<<05<38<05

<button>Export</button>
0

<03<<05<44<05

<button>Export</button>
0

________ 89 ________ 92 ________ 105 ________ 10

________ 89 ________ 8 ________ 105 ________ 10

<03<<05<58<05

<button>Export</button>
0

<03<<05<64<05

<button>Export</button>
0

<03<<05<70<05

<button>Export</button>
0

________ 89 ________ 92 ________ 105 ________ 10

________ 89 ________ 8 ________ 105 ________ 10

<03<<05<84<05

<button>Export</button>
0

<03<<05<90<05

<button>Export</button>
0

<03<<05<96<05

<button>Export</button>
0

________ 89 ________ 92 ________ 105 ________ 10

________ 89 ________ 8 ________ 105 ________ 10

<03<<05html10<05

<button>Export</button>
0

<03<<05html16<05

<button>Export</button>
0

<03<<05html22<05

<button>Export</button>
0

________ 89 ________ 92 ________ 105 ________ 10

________ 89 ________ 8 ________ 105 ________ 10

<03<<05html36<05

<button>Export</button>
0

<03<<05html42<05

<button>Export</button>
0

<03<<05html48<05

<button>Export</button>
0

________ 89 ________ 92 ________ 105 ________ 10

<button>Export</button>
5html2
<button>Export</button>
35html58

html59

<button>Export</button>
5<<6
<button>Export</button>
0

<button>Export</button>
03____965

<03html67

html68html69

html70

html68html72

html68html74

html70

<button>Export</button>
1____977

html68html79

<9____981

html82

html82

<button>Export</button>
03html85

<button>Export</button>
5html2<6
<button>Export</button>
0

_______11____92____110

<button>Export</button>
0

html2____9

<button>Export</button>
0

đầu ra

  • trước khi xuất

    Jquery table2excel nhiều bảng

  • Sau khi xuất trong 'GFGFile. xls'

    Jquery table2excel nhiều bảng

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




<!DOCTYPE html>

<____9

<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

<9

<button>Export</button>
0

<button>Export</button>
5html2<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

<03<

<button>Export</button>
05
<button>Export</button>
39<8
<button>Export</button>
076
<button>Export</button>
0

<03<<05

<button>Export</button>
0

________ 1082 ________ 1083 ________ 805 ________ 10

<button>Export</button>
086<<05
<button>Export</button>
089

<03html2____805

<button>Export</button>
0

________ 89 ________ 92 ________ 105 ________ 10

<03<

<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

<03<

<button>Export</button>
05
<button>Export</button>
101<05
<button>Export</button>
127<05
<button>Export</button>
0

<03<<05

<button>Export</button>
133<05
<button>Export</button>
01
<button>Export</button>
05
<button>Export</button>
0

html70

<03<

<button>Export</button>
05
<button>Export</button>
101<05
<button>Export</button>
144<05
<button>Export</button>
0

<03<<05

<button>Export</button>
150<05
<button>Export</button>
01
<button>Export</button>
05
<button>Export</button>
0

<button>Export</button>
03html2____1120
<button>Export</button>
0

<button>Export</button>
03<
<button>Export</button>
161
<button>Export</button>
0

<03<

<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>
03html2____1161
<button>Export</button>
0

<button>Export</button>
5html2
<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