我无法找到有关如何在 mat-table 中合并列单元格的答案。只看到了几个使用when
. 所以想知道我是否可以在这里找到答案。
我有这个JSON数据:
{
"id": 4,
"description": "this is another block",
"block_size": 3480,
"lot_count": 5,
"lots": [
{
"id": 17,
"lot_name": "test 17",
"status": "SOLD",
"block_id": 4,
"lot_id": 1,
"lot_size": 828
},
{
"id": 18,
"lot_name": "test 18",
"status": "OPEN",
"block_id": 4,
"lot_id": 2,
"lot_size": 885
},
{
"id": 19,
"lot_name": "test 19",
"status": "SOLD",
"block_id": 4,
"lot_id": 3,
"lot_size": 648
},
{
"id": 20,
"lot_name": "test 20",
"status": "OPEN",
"block_id": 4,
"lot_id": 4,
"lot_size": 553
},
{
"id": 21,
"lot_name": "Test 21",
"status": "OPEN",
"block_id": 4,
"lot_id": 5,
"lot_size": 566
}
]
}
并期望 mat-table 中的输出为:
+------------------------------------------------------------------+
| No. Lot Name Block Block Size Lot Id Lot Size |
+------------------------------------------------------------------+
| 17 test 17 1 828 |
| 18 test 18 2 885 |
| 19 test 19 4 3480 3 648 |
| 20 test 20 4 553 |
| 21 test 21 5 566 |
+------------------------------------------------------------------+
如您所见,我想让列块和块大小中的单元格合并。