CSV to html table
CSV to html table
在此中,只会打开一个CSV文件。我想打开多个 CSV 文件并在 HTML 表中编辑它们。请帮忙。
$(function() {
Papa.parse("abc.csv", {
download: true,
complete: function(results) {
console.log("Remote file parsed!", results.data);
$.each(results.data, function(i, el) {
var row = $("<tr/>");
row.append($("<td/>").text(i));
$.each(el, function(j, cell) {
if (cell !== "")
row.append($("<td/>").text(cell));
});
$("#results tbody").append(row);
});
}
});
});
你必须做一个循环,这里我们有一个你的csv文件数组:
var csv_array = ["abc.csv","def.csv","ghi.csv"];
$(function() {
$(csv_array).each(function(){
Papa.parse(this.toString(), {
download: true,
complete: function(results) {
console.log("Remote file parsed!", results.data);
$.each(results.data, function(i, el) {
var row = $("<tr/>");
row.append($("<td/>").text(i));
$.each(el, function(j, cell) {
if (cell !== "")
row.append($("<td/>").text(cell));
});
$("#results tbody").append(row);
});
}
});
})
});
相关文章:
- AppendChild Form / Table [Javascript/Html/PHP]
- Table HTML overflow
- CSV to html table
- Traversing through a html table
- Html dynamic table
- JSon HTML Table
- 使用 java 脚本导出 html table excel.找到“#”时不导出
- PHP and html table, using tablesorter javascript
- Dynamic table HTML Javascript
- html css hierarchical table
- javascript Highcharts JSON data to HTML table
- Ruby on Rails/HTML table
- Empty HTML Table
- ArrayList to update HTML Table
- HTML,CSS:Table dons'我不会相应地调整页面大小
- Append html table
- Html Search Table
- acts_as_votable javascript html table
- ng-repeat issue and html table
- HTML Table to Excel Javascript