D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
aaizemberg
Full window
Github gist
data matrix --> "html table" using d3.js
<!DOCTYPE html> <html> <head> <script src="https://d3js.org/d3.v3.min.js"></script> <meta charset="utf-8"> <title>tablas desde d3.js</title> <style> table,td{border:1px solid green;border-collapse: collapse;} td{padding: 8px;} </style> </head> <body> <script> var matrix = [ [1, 2, 2, 4], [5, 5, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16] ]; var tr = d3.select("body").append("table").selectAll("tr") .data(matrix) .enter().append("tr"); var td = tr.selectAll("td") .data(function(d) { return d; }) .enter().append("td") .text(function(d) { return d; }); </script> </body> </html>
Modified
http://d3js.org/d3.v3.min.js
to a secure url
https://d3js.org/d3.v3.min.js