Custom column width for each column
Hello everyone!
I would like to know how can i define a different width for each column as default. I know the default is 150px and i can only change the size for all columns at once, during the headers map.
I tried to do it dynamically using the column ID, but it doesnt work, it keeps changing the size of all columns.
7 Replies
eastern-cyan•3y ago
hey im facing the same problem, i saw that in the typing for the column there is minSize,maxSize and size, but even tho i apply the width after on the td ot th, the tables ignore it
rival-blackOP•3y ago
yes, the table ignores it and when you set the column size, minSize and maxSize in columnDef, it still ignores it, although it shows the size in the column's object
eastern-cyan•3y ago
I've tried also the answer provided on stack overflow with the defaultColumn width, no chance
rival-blackOP•3y ago
i didnt try that, but nothing worked for me
foreign-sapphire•3y ago
I am curious as well, it seems to be a basic functionnality. Weird that it is so hard to find it!
correct-apricot•3y ago
have anyone found this ?, i tried to work it with last: [tailwind] but doesnt seem to happen, btw how can we style the headers(individually)
generous-apricot•3y ago
It's a headless solution, meaning it might calculate the preferred width but ultimately it's up to you to actually apply said width to the DOM elements.
While rendering the td tags you can access the calculated size as cell.column.getSize(), use that to set the td tags size through your preferred solution (I personally use style for this specifically due to its dynamic nature)