SHARE
TWEET

Untitled

a guest Feb 14th, 2020 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. d3.text("data.csv", function(data) {
  2.     var parsedCSV = d3.csv.parseRows(data);
  3.  
  4.     var container = d3.select("body")
  5.         .append("table")
  6.  
  7.         .selectAll("tr")
  8.             .data(parsedCSV).enter()
  9.             .append("tr")
  10.  
  11.         .selectAll("td")
  12.             .data(function(d) { return d; }).enter()
  13.             .append("td")
  14.             .text(function(d) { return d; });
  15. });
  16. setTimeout(function(){
  17.     $(document).find('table').addClass('table').addClass('table-striped').addClass('table-bordered')
  18.     $(document).find('tr').first().addClass('bg-primary')
  19. }, 200)
  20. setTimeout(() => {
  21. const thWrapper = document.querySelector('.bg-primary')
  22. const ths = thWrapper.querySelectorAll('td');
  23. ths.forEach(el => { el.textContent = el.textContent.replace(/"/g, '')});
  24. }, 250)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top