I am trying to create a table linked to a *.csv file using d3, but all I get is a blank webpage.
Even with the example Crimea I get a blank page.
I would be
Often, I need to refresh a table of data periodically. Here's how I populate a table with data:
HTML:
Name Age
JavaScript:
function tabulate(data, columns) {
var table = d3.select("#t1");
table.select('tbody').remove(); // remove any existing data
var tbody = table.append('tbody');
data.forEach(function(row) {
var tr = tbody.append('tr');
columns.forEach(function(column) {
tr.append('td').text(row[column]);
});
});
return table;
}
Notes:
fiddle