Tải xuống table2excel js

Bài viết này sẽ giải thích cách chuyển đổi [xuất] tệp Bảng HTML sang Excel bằng plugin jQuery table2excel trong ASP. Net

 

 

Đá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

// npm install table2excel --save

import 'table2excel';

const Table2Excel = window.Table2Excel;

 

const table2excel = new Table2Excel[options];

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

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

// npm install table2excel --save

import 'table2excel';

const Table2Excel = window.Table2Excel;

 

const table2excel = new Table2Excel[options];

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

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ư

// npm install table2excel --save

import 'table2excel';

const Table2Excel = window.Table2Excel;

 

const table2excel = new Table2Excel[options];

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

Trình xử lý loại tế bào

// npm install table2excel --save

import 'table2excel';

const Table2Excel = window.Table2Excel;

 

const table2excel = new Table2Excel[options];

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

  • số
  • đầu vào. cho các phần tử

    // npm install table2excel --save

    import 'table2excel';

    const Table2Excel = window.Table2Excel;

     

    const table2excel = new Table2Excel[options];

    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
  • ngày. cố phân tích ngày hoặc đặt dấu thời gian chính xác qua

    // npm install table2excel --save

    import 'table2excel';

    const Table2Excel = window.Table2Excel;

     

    const table2excel = new Table2Excel[options];

    9 trên ô [được khuyến nghị. ]
  • Booleans. phân tích cú pháp

    // npm install table2excel --save

    import 'table2excel';

    const Table2Excel = window.Table2Excel;

     

    const table2excel = new Table2Excel[options];

    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
  • danh sách. phân tích các phần tử danh sách

    // npm install table2excel --save

    import 'table2excel';

    const Table2Excel = window.Table2Excel;

     

    const table2excel = new Table2Excel[options];

    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

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

// npm install table2excel --save

import 'table2excel';

const Table2Excel = window.Table2Excel;

 

const table2excel = new Table2Excel[options];

1

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

// npm install table2excel --save

import 'table2excel';

const Table2Excel = window.Table2Excel;

 

const table2excel = new Table2Excel[options];

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

Chủ Đề