AngularJS Example:
HTML
<div ng-app="" ng-controller="TableController">
<table>
<tr>
<th ng-repeat='header in headers'>{{header}}</th>
</tr>
<tr ng-repeat='row in rows'>
<td ng-repeat='value in row.data'>{{value}}</td>
</tr>
</table>
</div>
CSS
td {
border:1px #CCC solid;
padding:10px;
}
JavaScript
var data = [{
"id": 1,
"data": {
"Type": "Bicycle",
"Brand": "Diamondback",
"Color": "Black"
},
"created_at": "2013-12-02T01:05:20.956Z",
"updated_at": "2013-12-02T01:05:20.956Z"
}, {
"id": 2,
"data": {
"Type": "Motorcycle",
"Brand": "Harley",
"Color": ""
},
"created_at": "2013-12-02T01:05:20.956Z",
"updated_at": "2013-12-02T01:05:20.956Z"
}];
function TableController($scope) {
$scope.rows = data;
$scope.headers = [];
for(row in data) {
for(header in data[row].data) {
if($scope.headers.indexOf(header) == -1) {
$scope.headers.push(header);
}
}
}
}