Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

simple_html_to_excel

ManbokLee40MIT1.0.14

export excel file by HTML

html, excel

readme

simple_html_to_excel

export Excel file in HTML element contents.

install

npm install simple_html_to_excel --save

use

import { exportExcelById } from 'simple_html_to_excel'

exportExcelById('element_id')
<script type="module" src="https://unpkg.com/simple_html_to_excel@latest/dist/main.js" charset="utf-8"></script>
...
<script>
function download(id) {
  html_to_excel.exportExcelById(id)
}
</script>

methods

  • exportExcelById
    • Download Excel file by element uniq id
  • exportExcelByHtml
    • Download Excel file by HTML text (element.innerHTML)

arguments

  • exportExcelById
argument required type default
elementId true string -
fileName false string download.xls
sheetName false string Worksheet
  • exportExcelByHtml

    | argument | required | type | default | |---|---|---|---| | html | true | string | - | | fileName | false | string | download.xls | | sheetName | false | string | Worksheet |

warning

  • Only simple type exports
  • Displayed in a better format when using table elements.
  • Excel notification(type error) is displayed when you open the downloaded file.