Estimated reading time: 2 minutes
today, We have a exciting subject that how to Export Html Table Data into Excel using JavaScript.
you can use codes and copy them by clicking on copy buttons.
1. HTML:
name | shortcut |
---|---|
mark as unread | CtrlAltShiftU |
Nute | CtrlAltShiftN |
Archive Chat | CtrlAltShiftE |
Delete Chat | CtrlAltBackspace |
Pin Chat | CtrlAltShiftPSearch CtrlAlt/ |
Search Chat | CtrlAltShiftS |
New Chat | CtrlAltN |
New group | CtrlAltShiftN |
Profile and About | CtrlAltP |
Increase speed of selected voice message | Shift+. |
Decrease speed of selected voice message | Shift+, |
Settings | CtrlAlt, |
Emogy panel | CtrlAltE |
Gif panel | CtrlAltG |
Sticker panel | CtrlAltS |
2. JavaScript:
Code witten By sudhir K gupta.
My Blog – https://comedymood.com’
let a = document.createElement(‘a’);
a.href = `data:application/vnd.ms-excel, ${encodeURIComponent(tableData)}`
a.download = ‘downloaded_file_’ + getRandomNumbers() + ‘.xls’
a.click()
}
function getRandomNumbers() {
let dateObj = new Date()
let dateTime = `${dateObj.getHours()}${dateObj.getMinutes()}${dateObj.getSeconds()}`
return `${dateTime}${Math.floor((Math.random().toFixed(2)*100))}`
}
3. completed code:
name | shortcut |
---|---|
mark as unread | CtrlAltShiftU |
Nute | CtrlAltShiftN |
Archive Chat | CtrlAltShiftE |
Delete Chat | CtrlAltBackspace |
Pin Chat | CtrlAltShiftPSearch CtrlAlt/ |
Search Chat | CtrlAltShiftS |
New Chat | CtrlAltN |
New group | CtrlAltShiftN |
Profile and About | CtrlAltP |
Increase speed of selected voice message | Shift+. |
Decrease speed of selected voice message | Shift+, |
Settings | CtrlAlt, |
Emogy panel | CtrlAltE |
Gif panel | CtrlAltG |
Sticker panel | CtrlAltS |
So thank you for your reading and i wish all the best for you