I have an ag-grid in angular 6 and have columns and data dynamically attached to it. Now i want to align header for (both parent and children in case of multi header) dynamically. Like first column header should be left aligned and others will be center aligned.
I tried to set cellStyle and some other options i found, but none of them worked
I tried to implement it like :
let headerItem = {
headerName: name,
children: [
{
headerName: name,
field: 'col' + i + '.value',
hide: isHidden,
pinned: pinned,
cellStyle: function (params) {
try {
return {text-align : 'center'};
} catch (e) {
return null;
}
}
}
],
cellStyle: function (params) {
try {
return {text-align : 'center'};
} catch (e) {
return null;
}
}
}
Please guide how can i get this working...