bootstarp 表头合并组合

  $('#dataGrid1').bootstrapTableEx({
    url: '../../schoolGrade/statistic?_' + $.now(),
    height: $(window).height() - 90,
    pagination: false,
    queryParams: function (params) {
      params.selectDate = vm.selectDate;
      params.schoolType = vm.schoolType;
      params.schoolId = vm.schoolId;
      return params;
    },
    columns: [
      [
        { field: 'schoolName',title: "学校名称",width: "120px",align:"center",valign:"middle",colspan: 1,rowspan: 2},
        { field: 'schoolType',title: "学校类型",width: "80px",align:"center",valign:"middle",colspan: 1,rowspan: 2},
        { title: "一年级", width: "100px",align:"center",colspan: 2,rowspan: 1},
        { title: "二年级", width: "100px",align:"center",colspan: 2,rowspan: 1},
        { title: "三年级", width: "100px",align:"center",colspan: 2,rowspan: 1},
        { title: "四年级", width: "100px",align:"center",colspan: 2,rowspan: 1},
        { title: "五年级", width: "100px",align:"center",colspan: 2,rowspan: 1},
        { title: "六年级", width: "100px",align:"center",colspan: 2,rowspan: 1},
        { title: "总计", width: "100px",align:"center",colspan: 2,rowspan: 1}
      ],
      [
        {
          field: 'num1',
          title: '课间餐',
          align:"center",
          width: "50px"
        },
        {
          field: 'num2',
          title: '午间餐',
          align:"center",
          width: "50px"
        },
        {
          field: 'num3',
          title: '课间餐',
          align:"center",
          width: "50px"
        },
        {
          field: 'num4',
          title: '午间餐',
          align:"center",
          width: "50px"
        },
        {
          field: 'num5',
          title: '课间餐',
          align:"center",
          width: "50px"
        },
        {
          field: 'num6',
          title: '午间餐',
          align:"center",
          width: "50px"
        },
        {
          field: 'num7',
          title: '课间餐',
          align:"center",
          width: "50px"
        },
        {
          field: 'num8',
          title: '午间餐',
          align:"center",
          width: "50px"
        },
        {
          field: 'num9',
          title: '课间餐',
          align:"center",
          width: "50px"
        },
        {
          field: 'num10',
          title: '午间餐',
          align:"center",
          width: "50px"
        },
        {
          field: 'num11',
          title: '课间餐',
          align:"center",
          width: "50px"
        },
        {
          field: 'num12',
          title: '午间餐',
          align:"center",
          width: "50px"
        },
        {
          field: 'num13',
          title: '课间餐',
          align:"center",
          width: "50px"
        },
        {
          field: 'num14',
          title: '午间餐',
          align:"center",
          width: "50px"
        }
      ]
    ]
  })

 

你可能感兴趣的:(前端)