This is my CSV file:
Item, Quantity, Price;
LED, 100, $10;
PIR, 1, $5;
DS18B20, 10, $5;
This is my jquery file:
$(document).ready(function() {
$.ajax({
url: "data.csv",
success: function(result) {
var data = result;
var arr = data.split(";");
var len = arr.length - 1;
var a = 0;
var b = 0;
while (a < len) {
var orr = arr[a].split(",");
var err = orr.length;
b = 0;
while (b < err) {
if (a == 0) {
alert(orr[b]);
b = b + 1;
} else if (a > 0) {
alert(orr[b]);
b = b + 1;
}
};
a = a + 1;
};
}
});
});
this code gets the data and alerts. How do I get all the data turn the into a ordered table (i.e. the first line should be a table header).