Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
223 views
in Technique[技术] by (71.8m points)

html - How to add pagination in SheetJS Sheet_to_html

I am using sheetjs https://github.com/SheetJS/sheetjs for reading xlsx file and converting it into html for preview. For big excel files the browser get busy and consume lots of memory. Is there any way to overcome this issue, I am thinking to apply pagination.

Angular Component:

createHtmlTable(workBook: WorkBook) {
    this.sheetName = workBook.SheetNames[0];
    let generatedTableHtml: any = XLSX.utils.sheet_to_html(workBook.Sheets[workBook.SheetNames[0]],
      { id: 'DataTableDiv'/*, editable: true, */});
    
    generatedTableHtml = generatedTableHtml.replace('<table',
      '<table mat-table border="1"')
      .replaceAll('<tr>', '<tr><td></td>');

    const tableElement = document.getElementById('DataTableDiv');
    tableElement.innerHTML = generatedTableHtml;

  }

HTML:

<div id="DataTableDiv"></div>
question from:https://stackoverflow.com/questions/65623469/how-to-add-pagination-in-sheetjs-sheet-to-html

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...