Element-ui table header merge

vue + element-ui table
how headers are merged

clipboard.png

  <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 
Jun.12,2021

I also encountered the same problem. As a result, I solved
dom part

with CSS and slot.
            <el-table-column label="" width="300">
                <template slot-scope="scope">
                    <span>{{scope.row.name}}</span>
                    <span>{{scope.row.name}}</span>
                </template>
            </el-table-column>

css part
.el-table td {

            padding: 0px 0!important;
            .cell {
                line-height: 40px;
            }
            .cell span {
                border-right: 1px solid -sharpebeef5;
                padding: 10px 7px;
                width: 100px;
                display:inline-block;
            }
            .cell span:last-child{
                border: none;
            }
        }

result:


element-ui
http://element-cn.eleme.io/-sharp/...




:
tbody,


style


:

clipboard.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e582-40992.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e582-40992.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?