vue + element-ui table
how headers are merged
<el-table :data="tableData" :span-method="arraySpanMethod" style="width: 100%" border>
<el-table-column prop="date" label=" " width="180" align="center">
</el-table-column>
<el-table-column prop="name1" label="" width="180" align="center">
</el-table-column>
<el-table-column label="1" width="180 " align="center">
<el-table-column prop="zongliang" label="(m)" width="120" align="center">
</el-table-column>
<el-table-column prop="name" label="(m/)" width="120" align="center">
</el-table-column>
</el-table-column>
</el-table>
tableData: [{
date: "",
name1: "",
zongliang: "1",
name: "",
}, {
date: "",
name1: "",
zongliang: "1",
name: "",
}, {
date: "",
name1: "",
zongliang: "1",
name: "",
}, {
date: "",
name1: "",
zongliang: "1",
name: "",
}]
arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
console.log(rowIndex);
if (rowIndex % 2 === 0) {
if (columnIndex === 0) {
return [1, 2];
} else if (columnIndex === 1) {
return [0, 0];
}
}
},
rowIndex 0 1 2 4