Built with blockbuilder.org
xxxxxxxxxx
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$.ajax({
url: "../midata.csv",
dataType: 'text',
}).done(successFunction);
function successFunction(data){
var allRows = data.split(/\r?n|\r/);
var table = "<table>";
for (var singleRow = 0; singleRow < allRows.length; singleRow++) {
if (singleRow === 0 ) {
table += "<thead>";
table += "<tr>";
} else {
table += "<tr>";
}
var rowCells = allRows[singleRow].split(",");
for (var rowCell = 0; rowCells < rowCell.length; rowCell++) {
if (singleRow === 0) {
table += "<th>";
table += rowCells[rowCell];
table += "</th>";
} else {
table += "<td>";
table += rowCells[rowCell];
}
}
if (singleRow === 0) {
table += "</th>";
table += "</thead>";
table += "<tbody>";
} else {
table += "</tr>";
}
}
table += "</tbody>";
table += "</table>";
$('body').append(table);
};
</script>
<div>
</div>
</body>
https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js