I use bootrapTable to create the table. how can i use rowspan or colspan to create a table like this: image description here
$table.bootstrapTable({
columns: [{
formatter: 'rowIndex',
title: "No",
}, {
field: 'company',
title: 'test1',
sortable: true,
}, {
field: 'sum_employee',
title: 'test2',
sortable: true
}]
});
As stated here : https://bootstrap-table.com/docs/api/table-options/#data The span has be specified inside the data object loaded by bootstrapTable
You might consider giving more details as i have to imagine what's the use of the empty cell here.
Anyway, this will result in an object like this one :
$table.bootstrapTable({
data: [{
id: 1,
No: 1,
_No_rowspan: 2,
name: 'Test 1'
},
{
id: 2,
No: 1,
_No_rowspan: 2,
name: 'Test 2'
}]
})