table 合并表格

https://www.cnblogs.com/steamed-twisted-roll/p/9244846.html

https://blog.csdn.net/qq_29468573/article/details/80742646

https://www.jb51.net/article/161677.htm

方式一

 

 

    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 0) {
        if (rowIndex == 0) {
          return {
            rowspan: 1,
            colspan: 3,
          };
        } else if (columnIndex === 2 || columnIndex === 3) {
          return {
            rowspan: 0,
            colspan: 0,
          };
        }

方式二

 

 

    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 0) {
        if (rowIndex == 0) {
          return {
            rowspan: 3,
            colspan: 1,
          };
        } else if (rowIndex === 1 || rowIndex === 2) {
          return {
            rowspan: 0,
            colspan: 0,
          };
        }

 方式三

    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 0) {
        if (rowIndex == 0) {
          return {
            rowspan: 2,
            colspan: 1,
          };
        } else if (rowIndex === 1) {
          return {
            rowspan: 0,
            colspan: 0,
          };
        }
        if (rowIndex == 2) {
          return {
            rowspan: 2,
            colspan: 1,
          };
        } else if (rowIndex === 3) {
          return {
            rowspan: 0,
            colspan: 0,
          };
        }
      }
    },

 

 

posted @ 2020-05-15 23:09  ThisCall  阅读(309)  评论(0编辑  收藏  举报