Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- d3.text("data.csv", function(data) {
- var parsedCSV = d3.csv.parseRows(data);
- var container = d3.select("body")
- .append("table")
- .selectAll("tr")
- .data(parsedCSV).enter()
- .append("tr")
- .selectAll("td")
- .data(function(d) { return d; }).enter()
- .append("td")
- .text(function(d) { return d; });
- });
- setTimeout(function(){
- $(document).find('table').addClass('table').addClass('table-striped').addClass('table-bordered')
- $(document).find('tr').first().addClass('bg-primary')
- }, 200)
- setTimeout(() => {
- const thWrapper = document.querySelector('.bg-primary')
- const ths = thWrapper.querySelectorAll('td');
- ths.forEach(el => { el.textContent = el.textContent.replace(/"/g, '')});
- }, 250)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement