Supply Column headers in Streamlit Apps

The text_input widget and text_area widget are limited with respect to the above. If I upload a data file without columns or headers, which widget or function can help users supply as many headers as required by the dataset.
Thank you

I think you could still use the text widgets, but you’d need to have a validation step. After the file uploader step, read the file into pandas. Get the count of columns, return that as a prompt to the user “Please input x columns”, and don’t move forward until they do.

But in terms of the widgets “being limited”, this is a pretty specific use case, not sure how we’d build this generically into Streamlit.


Thank you for your response,
Kindly provide the code for the input prompt to enable user enter the number of vacant columns in the dataset.

Secondly, with respect to the widgets, I was referring to the text input widget only, it was not a general reference.
Thank you