Skip to content

help(Material Data Table): Dynamically Adjusting Angular Material Data Table Sticky Column Width? #23099

@fireflysemantics

Description

@fireflysemantics

What are you trying to do?

Adjust with width of a sticky column using ngStyle.

What troubleshooting steps have you tried?

I asked about it here on Stackoverflow. The questions include a Stackblitz demo:

https://stackoverflow.com/questions/68198786/dynamic-adjustment-of-angulars-positioning-of-material-data-table-sticky-column

https://stackoverflow.com/questions/68202545/how-to-override-angular-material-data-table-css-styles-when-the-table-is-package

What are you seeing that does not match your expectations?

Detailed explanation in SO post ... It looks like Angular is calculating the left position of the sticky table column, and using the packaged CSS to do so ... so when the CSS is overridden with a shorter width that is dynamically applied with ngStyle a gap appears between the sticky columns.

Reproduction

https://stackblitz.com/edit/angular-material-data-table-module-styling-sticky-column-adjust?file=src%2Fapp%2Fapp.component.css

Environment

  • Angular: 12

Metadata

Metadata

Assignees

Labels

needs triageThis issue needs to be triaged by the teamtroubleshootingThis issue is not reporting an issue, but just asking for help

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions