Setup Basic Table
Momentum Table requires value as an array of objects to render rows.
countries = [
{'country': 'Afghanistan', 'population': 35530081, 'capital': 'Kabul', 'continent': 'Asia'},
{'country': 'India', 'population': 1339180127, 'capital': 'New Delhi', 'continent': 'Asia'},
{'country': 'France', 'population': 64979548, 'capital': 'Paris', 'continent': 'Europe'},
{'country': 'Germany', 'population': 82114224, 'capital': 'Berlin', 'continent': 'Europe'},
{'country': 'Austria', 'population': 8735453, 'capital': 'Vienna', 'continent': 'Europe'}
];
Then countries array could be used in template to plot Data Table
<m-table [value]=countries>
<m-column field="country"></m-column>
<m-column field="population"></m-column>
<m-column field="capital"></m-column>
<m-column field="continent"></m-column>
</m-table>
Table Component m-table
Properties
Name | Default | Description |
---|---|---|
@Input() value: any[] |
null | Defines rows of data table |
Column Component m-column
Properties
Name | Default | Description |
---|---|---|
@Input() field: string |
null | property of Row data |