How to set column size in UTable?
I've tried setting up size and minSize on the columns definition but it simply does nothing and the column-sizing prop only accepts a string and number, tried using stringID: anyNumber and it didn't work either
2 Replies
Hi @i.wont.tell. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To set column sizes in
You are using the correct documented properties (
UTable, you can use the size, minSize, and maxSize properties on each column definition. These properties are documented as valid options for columns:
- size?: number — The desired size for the column
- minSize?: number — The minimum allowed size for the column
- maxSize?: number — The maximum allowed size for the column
Example column definition:
However, the knowledge sources do not provide a working example or confirm that these properties are currently effective in the Nuxt UI UTable component. The documentation lists these options, but there is no explicit demonstration or guarantee that setting them will actually affect the rendered column widths in practice. If you have already tried these properties and they do not work, it may be a limitation or a bug in the current implementation of UTable in Nuxt UI.
The columnSizing prop is also mentioned, but the documentation does not provide a clear example of its usage or expected format, and it only states its type as an object, not a string or number. There is no further detail on how to use it to control column widths programmatically.
Summary:You are using the correct documented properties (
size, minSize, maxSize), but the knowledge sources do not confirm their effectiveness or provide troubleshooting steps if they do not work. If these options are not working as expected, it may be due to a limitation in the current version of Nuxt UI's UTable component, and you may need to check for updates or report the issue to the maintainers.
See column sizing props in the documentation
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@450429685122334730> Kapa.ai is still learning and improving, please let me know how I did by reacting below.