角材料表,具有重复的表头

时间:2018-07-24 06:28:07

标签: angular angular-material2

每次尝试更改类别时,我都尝试使用Angular Material Table创建一个具有新标题的表。标头必须是整个表的一部分,因为列宽对于整个表必须保持相同。

enter image description here

这里是示例数据:

[
    {
      "id": 1,
      "name": "Leanne Graham",
      "category": {
        "id": 1,
        "name": "bar1"
      }
    },
    {
      "id": 2,
      "name": "Ervin Howell",
      "category": {
        "id": 1,
        "name": "bar1"
      }
    },
    {
      "id": 3,
      "name": "Clementine Bauch",
      "category": {
        "id": 1,
        "name": "bar1"
      }
    },
    {
      "id": 4,
      "name": "Patricia Lebsack",
      "username": "Karianne",
      "category": {
        "id": 2,
        "name": "bar2"
      }
    }
]

这是我的例子: https://stackblitz.com/edit/angular-material-table-subheaders

0 个答案:

没有答案