I want to have the following behaviour:
- A border in the middle of the table, that separates the table in two part
- I want to "group" the row by item, meaning I want a visible separation when the item changes
For the 1, no problem
<b-table :fields="fields"
:items="incoherences"
:tbody-tr-class="rowClass"
></b-table>
// (computed property)
get fields() {
if (this.incoherences.length === 0) return null
const fields = Object.keys(this.incoherences[0])
return fields.map(field => {
if (field === 'devis2') {
return {
key: field,
tdClass: 'with-left-border',
thClass: 'with-left-border',
}
} else {
return field
}
})
}
We don't see very well, but there is a vertical border between Date Fin1 and Devis2 columns. There is also a border between each row.
In the image, I want to have a border at the bottom item 14 (to kind of group them together) and then group the 15, 16 , 17,... alone. So I did this code
lastItemIdBrowser = 0
// (method)
rowClass(item: Incoherence, type: any) {
let ret = false
if (!item || type !== 'row') return
if (item.item1 !== this.lastItemIdBrowser && this.lastItemIdBrowser !== 0) ret = true
this.lastItemIdBrowser = item.item1
if (ret) return 'with-top-border'
}
But it has no effect. To see the desired effect, I have to give the table the borderless prop, but then I lost all my other borders:
<b-table :fields="fields"
:items="incoherences"
:tbody-tr-class="rowClass"
borderless
></b-table>
Does someone know how to combine those features without loosing the other one ?