Table Column Width

I am using TextColumns and TextInputColumns in my table of products. Problem is that there are a lot of columns, most of which are TextInput, and I am unable to change the size of the TextInput column. The input field of the Weight column is too wide and that makes the table stretch too much. I tried setting extraAttributes, extraInputAttributes, extraCellAttributes but i could not find a solution. Thanks for any help
No description
No description
3 Replies
toeknee
toeknee4mo ago
You can adjust the width still
lakluk1779
lakluk1779OP4mo ago
I have tried setting the width with ->width('10%') (as well as with other values) with ->extraAttributes(['style' => 'width: 140px; ']) as well as with the same parameters in ->extraInputAttributes(), ->extraCellAttributes() and the most I managed to change it resulted it to spill into the name column on the left. I am fairly new to Filament and I never liked styling components so this is not my cup of tea 😄
toeknee
toeknee4mo ago
on the TextInputColumn use
->extraAttributes(['style' => 'max-width:165px'])
->extraAttributes(['style' => 'max-width:165px'])
If the name spills then split increase the width to the name width? Or split it.
->label(new HtmlString('My Column<br/>Name'))
->label(new HtmlString('My Column<br/>Name'))

Did you find this page helpful?