How to add width to TextInputColumn in a table?
I have the following type of column:
TextInputColumn::make('siren_number')
How can I provide it more width so the content is visible?![No description](https://cdn.answeroverflow.com/1324440810653093972/image.png)
22 Replies
->limit(100)
or whatever limit you wantGet this error when adding a
limit(100)
to TextInputColumn
:
Method Filament\Tables\Columns\TextInputColumn::limit does not exist.
Ohhh, thats right.. 1m
Any ideas anybody?
Did you try to use ->grow() to the TextInputColumn? Or maybe use ->extraAttributes to specify width
https://filamentphp.com/docs/3.x/tables/columns/getting-started#controlling-the-width-of-columns
https://filamentphp.com/docs/3.x/tables/columns/getting-started#custom-attributes
Thank you @idk - This has worked for me:
TextInputColumn::make('siren_number')->extraAttributes(['style' => 'width: 500px']),
Nice!
I have a similar problem.
I want my TextInputColumn to be smaller, the options above did not solve my problem.
With about 5 numbers that are visible when I put it in the input would be fine.
![No description](https://cdn.answeroverflow.com/1325700939767742465/image.png)
Hi @TheDagofugo, I see you're experiencing similar problem as I did.
Have you tried setting the style? To something like:
->extraAttributes(['style' => 'width: 50px'])
I am having the same issue. This didn't work for me. Did you find a solution?
Hi, what version of filament are you using?
Also, have you tried doing a hard refresh?
The latest version of Filament and have tried to hard refresh but no luck.
Could you try to set the value to something like
500px
- I wonder if there is a min width set.500px does change its width. But if I try for example 50 or 20 nothing happens. When I look at the computed styles there is no min-width set.
Which element are you inspecting? Because it's not the
input
you should be inspecting, it's the container that is wrapping the input or the container before it.
Set the width to something like 27px
and find the div
that has a width
set to that. Once you find the element, you should then see if it has a min-width
.It looks like i am inspecting the wrong div. However how can I change the width of the parent div using
extraAttributes
![No description](https://cdn.answeroverflow.com/1330622941448241242/Screenshot_2025-01-19_at_20.36.29.png)
That looks like Tailwind class.
I think what you can do is something like:
However, I doubt that might work - as you may to remove the original class that is there. How you do that, I'm not sure I'm afraid. I'd suggest raising a new post, someone with better knowledge within this area may assist you.
Well, this seems to work
![No description](https://cdn.answeroverflow.com/1330624484750790780/Screenshot_2025-01-19_at_20.46.30.png)
Much better
Is that adding
'class' => 'min-w-20'
?Yes it is
I have to come back on this. It doesn't work. I have seen it working last sunday but now not anymore.
I still have: