T
TanStack2y ago
genetic-orange

How column width calculated 'under the hood'

I'm interested ho column width is calculated under the hood. F.e. I have a table with a width 100% of its parent container. I have 2 columns in the table. When I inspect them I see that they have different values of width, but maybe If the content of any of the columns is not too wide, I expect to have 2 equal-width columns, but they are not. What is the logic of calculating the width of columns? Small reproducible example: https://t.ly/g6yGw
2 Replies
stormy-gold
stormy-gold2y ago
An html table component has in each browser an own calculation of the width per column based on the content of the table. (if you make thing virtual you will see the width be changing as you scroll) and it is often adviced by the html purists to let the table handle things... Personally I find it annoying UX to have columns bumping left and right, but I don't want to switch to div container kind of table where the control of the column width is much easier. This is just my experience with it though. Maybe someone brighter has figured it all out with table... I hope so...
genetic-orange
genetic-orangeOP2y ago
@KevinVandy could you please help?

Did you find this page helpful?