http://sheetjs.com/demos/table.html
http://sheetjs.com/demos/Export2Excel.js
// Export2Excel.js line 8
var columns = row.getElementsByTagName('td');
// Fixed: get TH cell
if(!columns.length) { columns = row.getElementsByTagName('th'); }
@axolo It's technically not invalid to have both td and th in the same row:
<table><tr><td>td</td><th>th</th></tr></table>
| td | th |
|---|
That whole thing needs to be changed. It probably should loop through all of the elements (e.g. getElementsByTagName('*') works in IE6+) and check for td or th tags
Since we will be needing similar functionality in the future for better processing HTML-as-XLS files, we will be folding the logic into the main library as a utility function table_to_sheet. Stay tuned.
Most helpful comment
@axolo It's technically not invalid to have both
tdandthin the same row:That whole thing needs to be changed. It probably should loop through all of the elements (e.g.
getElementsByTagName('*')works in IE6+) and check for td or th tags