i want to create a matrix like table with no numerical values. 1. i have a database table:
| CODE | STIL | SUBSTIL | PRODUS |
|------|-------|----------|---------|
| R | stil1 | substil1 | produs1 |
| R | stil1 | substil2 | produs2 |
| T | stil1 | substil3 | produs3 |
| T+ | stil2 | substil4 | produs4 |
| G | stil2 | substil4 | produs5 |
| R | stil3 | substil5 | produs6 |
| R | stil4 | substil6 | produs7 |
from this table i can get a jsonfile:
var data = [ {"code": "R","stil": "stil1","substil": "substil1","produs": "produs1"}, {"code": "R","stil": "stil1","substil": "substil2","produs": "produs2"}, {"code": "T","stil": "stil1","substil": "substil3","produs": "produs3"}, {"code": "T+","stil": "stil2","substil": "substil4","produs": "produs4"}, {"code": "G","stil": "stil2","substil": "substil4","produs": "produs5"}, {"code": "R","stil": "stil3","substil": "substil5","produs": "produs6"}, {"code": "R","stil": "stil4","substil": "substil6","produs": "produs7"} ];
I want as final result a table like this:
| CODE | stil1 | stil2 | stil3 | stil4 |
| | substil1 | substil2 | substil3 | substil4 | substil5 | substil6 |
|------|----------|----------|-----------|----------|----------|----------|
| R | produs1 | | | | | |
| R | | produs2 | | | | |
| R | | | | produs6 | | |
| R | | | | | | produs7 |
| T | | | produs3 | | | |
| T+ | | | | produs4 | | |
| G | | | | produs5 | | |
I tried using this
http://bost.ocks.org/mike/nest/
http://bl.ocks.org/mbostock/844752
recursively (or iteratively) make a nested html table with d3.js?
Thank you for any hint.