У меня есть массив объектов, в котором у каждого объекта есть список подзаголовков, который затем может иметь подзаголовки.Я хочу создать таблицу thead на основе списков подзаголовков в массиве.
Я хочу таблицу следующим образом:
<table border="1">
<tbody>
<thead ><th colspan="10">Lavere grads nivå</th>
<th colspan="10"> Integrert mastergrad/profesjon</th>
</thead>
<thead ><th colspan="5">Kvalifisert</th>
<th colspan="5"> Alle</th>
<th colspan="5">Kvalifisert</th>
<th colspan="5"> Alle</th>
</thead>
<thead>
<th>2014</th>
<th>2015</th>
<th>2016</th>
<th>2017</th>
<th>2018</th>
<th>2014</th>
<th>2015</th>
<th>2016</th>
<th>2017</th>
<th>2018</th>
<th>2014</th>
<th>2015</th>
<th>2016</th>
<th>2017</th>
<th>2018</th>
<th>2014</th>
<th>2015</th>
<th>2016</th>
<th>2017</th>
<th>2018</th>
</thead>
</tbody>
</table>
Ниже приводится мой массив, который мне нужно связать в заголовке таблицы:
"headers": [
{
"text": "Lavere grads nivå",
"headerRange": "B7:K7",
"headerRowIndex": 7,
"colCount": 10,
"subHeaders": [
{
"text": "Kvalifisert",
"headerRange": "B8:F8",
"headerRowIndex": 8,
"colCount": 5,
"subHeaders": [
{
"text": "2014",
"headerRange": "B9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2015",
"headerRange": "C9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2016",
"headerRange": "D9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2017",
"headerRange": "E9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2018",
"headerRange": "F9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
}
]
},
{
"text": "Alle",
"headerRange": "G8:K8",
"headerRowIndex": 8,
"colCount": 5,
"subHeaders": [
{
"text": "2014",
"headerRange": "G9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2015",
"headerRange": "H9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2016",
"headerRange": "I9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2017",
"headerRange": "J9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2018",
"headerRange": "K9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
}
]
}
]
},
{
"text": "Integrert mastergrad/profesjon",
"headerRange": "L7:U7",
"headerRowIndex": 7,
"colCount": 10,
"subHeaders": [
{
"text": "Kvalifisert",
"headerRange": "L8:P8",
"headerRowIndex": 8,
"colCount": 5,
"subHeaders": [
{
"text": "2014",
"headerRange": "L9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2015",
"headerRange": "M9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2016",
"headerRange": "N9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2017",
"headerRange": "O9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2018",
"headerRange": "P9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
}
]
},
{
"text": "Alle",
"headerRange": "Q8:U8",
"headerRowIndex": 8,
"colCount": 5,
"subHeaders": [
{
"text": "2014",
"headerRange": "Q9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2015",
"headerRange": "R9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2016",
"headerRange": "S9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2017",
"headerRange": "T9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
},
{
"text": "2018",
"headerRange": "U9",
"headerRowIndex": 9,
"subHeaders": null,
"colCount": 0
}
]
}
]
}
]

Не могли бы вы помочь мне в достижении этого?
Я пытался использовать ngFor, но не смог создать строку со списком всех подзаголовков.