Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(table): Specifying max-width with % on a table column doesn't work #30205

Open
1 task
sdedieu opened this issue Dec 18, 2024 · 5 comments
Open
1 task

bug(table): Specifying max-width with % on a table column doesn't work #30205

sdedieu opened this issue Dec 18, 2024 · 5 comments
Labels
needs triage This issue needs to be triaged by the team

Comments

@sdedieu
Copy link

sdedieu commented Dec 18, 2024

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Hello 👋

It might be a duplicated issue, but I couldn't find the exact same in the previous ones....

I'd like to specify a max-width: 20% on a table column. However it does not seems work.

What I'm I missing ?

Reproduction

StackBlitz link: https://stackblitz.com/edit/eqepaugy-ht92gcfb?file=src%2Fexample%2Ftable-basic-example.html
Steps to reproduce:

  1. Open the StackBlitz
  2. Resize the Symbol column (it is not supposed to be wider than 5%, yet it can)

Expected Behavior

Being able to specify a max-width in % for some columns.

Actual Behavior

max-width in % on <table mat-table> columns are not taken into account.

Environment

  • Angular: 19, 18, 17, 16, 15
  • CDK/Material: 19, 18, 17, 16, 15
  • Browser(s): Chrome, Firefox
  • Operating System (e.g. Windows, macOS, Ubuntu): Mac
@sdedieu sdedieu added the needs triage This issue needs to be triaged by the team label Dec 18, 2024
@shhdharmen
Copy link

You can not apply style to ng-container.

@sdedieu
Copy link
Author

sdedieu commented Dec 20, 2024

You can not apply style to ng-container.

Good catch, it is a silly mistake I did creating the stackblitz example. I've updated it, but the question still remains.

It works with [style.width.%]="5" but not with [style.max-width.%]="5".

@shhdharmen
Copy link

It's more of a CSS thing I believe, not related to Angular Material.

@sdedieu
Copy link
Author

sdedieu commented Dec 20, 2024

It's more of a CSS thing I believe, not related to Angular Material.

Do you mean it is not possible to set the max-width of a td element ? 🧐

@sdedieu
Copy link
Author

sdedieu commented Dec 21, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue needs to be triaged by the team
Projects
None yet
Development

No branches or pull requests

2 participants