Aha. Takze si dej do google http request example. A import excel csv to html table javascript. (predpokladam, ze z excelu exportujes csv a ne xls)
Tohle je takovy osizeny kod z jedne stranky. CSV ma jinou strukturu a navic, excel tam dava stredniky a ne carky. Ale mozna ti to bude stacit.
function makeTable ( csv ) {
var rows = csv.split('\n'),
table = document.createElement('table'),
tr = null, td = null,
tds = null;
for ( var i = 0; i < rows.length; i++ ) {
tr = document.createElement('tr');
tds = rows[i].split(',');
for ( var j = 0; j < tds.length; j++ ) {
td = document.createElement('td');
td.innerHTML = tds[j];
tr.appendChild(td);
}
table.appendChild(tr);
}
document.appendChild(table);
}
Jestli bys to chtel testnout
var csv = "\
aa,bb,cc,dd\n\
aa,bb,cc,dd\n\
aa,bb,cc,dd\n\
aa,bb,cc,dd\n\
";
makeTable(csv);