How do i set autoColumnWidth on a Table?

I have tried to set it with a js query but it doesnt seem to work.

Welcome to the forum!

Hi thanks for the reply, but there is a property called autoColumnWidth, but im not able to set it via javascript, i was wondering how to do that.

I don't believe it can be done programmatically at this time

1 Like

ok Thanks, its interessting because its mentioned here:

Hi @Martin_M Thanks for reaching out. As Scott mentions, autoColumnWidth is a read only property, so it currently cannot be set with Javascript.

It looks like that property is actually for a table configuration setting that is available yet. When it the feature ships, autoColumnWidth will be controlled by a checkbox under Appearance->Advanced

Hi all, if you're interested in changing this setting before it's available in the editor UI, you can read my post about it here - Table column width feature request - #4 by mitchmess

1 Like

Thank you! It looks like we just shipped an auto width checkbox under Appearance -> Advanced:

1 Like

I would love to be able to change this programmatically, since sometimes the auto column width doesn't work very well and I need to be able to switch it back to read things. Or make it so when auto column width is true, you can still manually change the width of the columns like the legacy table.

Hi @szabon,

We have a request in our backlog to allow manually changing the width of auto columns, and we also have a request to improve the auto width option. I'll let you know if either request gets picked up

1 Like

Hii @Martin_M
Go to the appearance then open advance, there you can see the option to set automatic column width
image

In my case, I can see the desired effect from inside the Retool editor, but once I press the play icon - to use the app on behalf of the end user - the columns are shrunken down to occupy very limited space. You can try this out yourself; not sure what might be causing it, I am using 42 columns, but that doesn't seem to be a problem in the editor mode.

Anyway, would love your response after looking into this. Thanks!

Hi @emozio If you can share a screenshot, I think that would be helpful! I haven't necessarily been able to reproduce this

Here's my dummy data (42 columns) with automatic column width vs not in Preview:

Apologies for the late response. I will try to find one that doesn't include sensitive data. Some further context: We are using dynamic data and columns.

1 Like

Is there an update on having the option for automatic column widths for some columns and fixed for others? The table doesn't display very well at the moment in certain circumstances. The best feature would be to have a fill option for a column or certain columns, then the others can be fixed width and the table adjusts based on this.

Hi @willtatts,

Thanks for chiming in! Definitely agree with you :blush: Unfortunately, I don't have an update yet :disappointed: I will follow up here if that changes

We would like a feature that permits automatic column width, but not does not expand to fit.

In other words, the content within a cell designates the width of the cell, and there is still the option to scroll horizontally when there are too many columns to fit in view.

Right now, it seems there is no way to do this, and users must constantly readjust the columns to get the ideal view.

1 Like

Thanks, @A_jay,

I agree! We're tracking feedback for this in our backlog, so I'll follow up here if it gets picked up