modern-xlsx API Reference - v1.3.0
    Preparing search index...

    Function sheetToHtml

    • Convert a Worksheet to an HTML table string.

      A boolean cell shows TRUE or FALSE, as Excel shows it on the sheet; every other cell shows its stored value, HTML-escaped.

      Parameters

      Returns string

      An HTML <table> string.

      ModernXlsxError with code SIZE_LIMIT when the rows from the first to the last populated row times the columns up to the widest row exceed V8's maximum string length (2^29 - 24 characters), which a table of that many cells could not fit.

      const html = sheetToHtml(ws, { header: true, className: 'data-table' });
      const container = document.getElementById('container');
      if (container) container.innerHTML = html;