csv file to table (dataTables plugin)
Hi, I am having an issue with importing a csv file into a table, namely dataTables plugin. I see that the arrContainer array is being populated with csv data, but for some reason the data isn't being written to the page. I checked the DOM in FF and arrContainer is getting data. Any suggestion greatly appreciated.
- $(function() {
$.get("csv/flood_reports.csv", function(data) {
arrContainer = $.csv()(data);
/*******************************/
$.each(arrContainer, function() {
var row = String(this).split(",");
if (row[0] != "") {
$('.tableContent').append("" + row[0] + "," + row[1] + "");
$('.tableContent').append("" + row[2] + "" + row[3] + "" + row[4] + "");
}
});
});
$('#tableContent').dataTable({
"sPaginationType": "full_numbers"
});
});