Đánh dấu HTML
Đánh dấu HTML bao gồm một Bảng HTML và một ASP. nút lưới
Bên trong trình xử lý sự kiện sẵn sàng cho tài liệu jQuery, Nút Xuất đã được gán một trình xử lý sự kiện Nhấp chuột jQuery
Khi nhấp vào nút Xuất, plugin jQuery table2excel được áp dụng cho Bảng HTML và nó được chuyển đổi [xuất] sang tệp Excel
9 là plugin javascript vani được biên dịch ecma5 để chuyển đổi và tải xuống các bảng html thành tệp xlsx có thể mở được trong Microsoft Excel// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
Nó sử dụng plugin js-xlsx tuyệt vời từ Sheet JS làm phần phụ thuộc. Thanks
Thử nghiệm
Bắt đầu nhanh
var table2excel = new Table2Excel[];
table2excel.export[document.querySelectorAll["table"]];
Nút
// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
Xem cấu hình
0 của tôi để biết cách chạy// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
1 với// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
0 trong trình duyệt// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
Tùy chọn bổ sung
Bạn có thể chuyển các tùy chọn dưới dạng tham số như
3. Các tùy chọn hiện được hỗ trợ là// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
4. Tên tệp chung của tài liệu đã tải xuống. Vỡ nợ.// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
5. Cũng có thể được điều chỉnh riêng cho// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
0 như một tham số thứ hai, e. g.// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
1// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
2. Tên thuộc tính dữ liệu để xác định tên trang tính của bảng. Vỡ nợ.// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
3. Cách sử dụng.// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
4. Nếu không được đặt, các trang tính được đánh số tăng dần từ 1// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
Trình xử lý loại tế bào
9 mặc định phát hiện một số ô đặc biệt để hiển thị chúng chính xác trong Excel// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
- số
- đầu vào. cho các phần tử
6,// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
7 hoặc// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
8// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
- ngày. cố phân tích ngày hoặc đặt dấu thời gian chính xác qua
9 trên ô [được khuyến nghị. ]// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
- Booleans. phân tích cú pháp
10,// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
11 hoặc hộp kiểm/radio không có văn bản thành boolean// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
- danh sách. phân tích các phần tử danh sách
12 hoặc// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
13 thành// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
14// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
Mọi thứ khác sẽ chỉ được hiển thị dưới dạng văn bản đơn giản. Bạn có thể dễ dàng thêm trình xử lý loại tùy chỉnh cho nhu cầu của riêng bạn
1// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
Giá trị trả về phải là đối tượng ô js-xlsx
Đóng góp
Nếu bạn muốn gửi yêu cầu kéo với bất kỳ thay đổi nào bạn thực hiện, vui lòng. Chỉ cần chạy
15 để kiểm tra và// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];
16 để biên dịch trước khi gửi yêu cầu kéo// npm install table2excel --save
import 'table2excel';
const Table2Excel = window.Table2Excel;
const table2excel = new Table2Excel[options];