I want to show my bootstrap-table by putting the columns headers on the left side and the row headers on the top. I'm getting the data from JSON. Any help? Thanks
Here is an idea of my code (JSON is hard coded just for testing the rotation of the table) :
<table id="table">
<thead class="thead-dark" >
<tr>
<th data-align="center" data-sortable="true" data-field="column1">COLUMN 1</th>
<th data-align="center" data-sortable="true" data-field="column2">COLUMN 2</th>
<th data-align="center" data-sortable="true" data-field="column3">COLUMN 3</th>
</tr>
</thead>
</table>
<script>
var $table = $('#table')
$(function() {
var data = [
{
'column1': 'value1',
'column2': 'value11',
'column3': 'value12'
},
{
'column1': 'value2',
'column2': 'value21',
'column3': 'value22'
},
{
'column1': 'value3',
'column2': 'value31',
'column3': 'value32'
},
{
'column1': 'value4',
'column2': 'value41',
'column3': 'value42'
},
{
'column1': 'value5',
'column2': 'value51',
'column3': 'value52'
},
{
'column1': 'value6',
'column2': 'value61',
'column3': 'value62'
}
]
$table.bootstrapTable({data: data})
})
</script>