quasar
quasar copied to clipboard
QTable: Option to set auto width in column definition
Is your feature request related to a problem? Please describe.
Currently you need to override the body cell to set auto-width, which is cumbersome if you're working with dynamically created columns.
Describe the solution you'd like
Like you can set so many other properties for a column, it would be nice if you can set auto-width as well.
Describe alternatives you've considered Adding a general slot override for specific columns, having to add content manually as well.
Just add a q-table--col-auto-width class to classes and headerClasses props in the column definition.
I am closing the issue for inactivity. If this is still a concern, please create a conversation in the Discussions area or feel free to reopen.
I vote for re-opening this.
auto-width is already available on the low level components QTh and QTd, and the solution with q-table--col-auto-width is both inelegant and (most importantly) undocumented.
Adding auto-width to the column definition object solves both, and thus provides an elegant documented solution to a common problem.
@hawkeye64 would you consider reopening based on the reasoning above?
Sure, sounds reasonable. I am going to let @rstoenescu weigh in.
Seems like having an auto-width prop could certainly add the q-table--col-auto-width class where appropriate.
Yeah this would be ideal to have an option to set this on the top level <q-table auto-width .../>
I agree that it would be helpful to find a better solution for this.
Is there any update on this feature request @rstoenescu ? And if the team don't want to implement it / doesn't have time - is it greenlighted for someone to make PR for it?