I'm trying to provide dynamic styling to a MatHeaderCell
instance like this:
[ngStyle]="styleHeaderCell(c)"
I can see that:
styleHeaderCell(c)
Receives the column and returns and object however the style is not applied, and so the column still has a min width of 12rem
and I want it to be 4rem
. Thoughts?
It appears to be a syntax issue in your styles
helper function.
Give this a try.
public styles: any = {
ID: {
'min-width': '4rem',
'background-color': 'red'
}
};
STACKBLITZ