Utility to allow pasting data intact from Excel into an HTML table
npm install paste-from-excel
npm install paste-from-excel
`
Usage with libraries
$3
`jsx
import parse from 'paste-from-excel'
const handlePaste = (e) => {
return parse(e)
}
return (
/ TableCells with inputs /
)
`
$3
`jsx
import parse from 'paste-from-excel'
const handlePaste = (e) => {
const options = {
rowSelector: '.rt-tr-group',
cellSelector: '.rt-td'
}
return parse(e, options)
}
return (
data={data}
columns={columns}
/>
)
`
Usage with plain HTML
`html
`
$3
rowSelector
- Sets the selector to identify a "row". Default: tr
cellSelector
- Sets the selector to identify a "cell". Default: td
inputSelector
- Sets the selector for the element that act on the paste event, and to find suceeding "editable elements". Default: input`