function print_request (json) {
var array_key = [];
$.each( json , function( key, val ){
array_key = [];
$.each( val , function( key, val ){
array_key.push(key);
});
});
var table_sql = '';
$('#table_sql').text('');
table_sql += '<table class="striped"><thead><tr>';
for(var i=0; i <array_key.length; i++) {
table_sql += '<th>'+array_key[i]+'</th>';
}
table_sql += '</tr></thead><tbody>';
$.each( json , function( key, val ){
table_sql += '<tr>';
$.each( val , function( key, val ){
table_sql += '<td>'+val+'</td>';
});
table_sql += '</tr>';
});
table_sql += '</tbody></table>';
$('#table_sql').append(table_sql);
}
const MyTr = ({row}) => (
<tr>
{row.map((v, k) => <td key={k}>{v}</td>)}
</tr>
);
class MyTable extends Component {
render() {
const { data } = this.props;
return (
<Table>
{data.map((v, k) => <MyTr data={v} key={k}) />
</Table>
)
}
}