Skip to content

Is it possible to set the width of a DataTable column? #4770

Answered by TomJGooding
bjesus asked this question in Q&A
Discussion options

You must be logged in to vote

The cells/rows/columns in a DataTable aren't widgets, so I'm afraid you won't find any solution using Textual's CSS.

The DataTable.add_column method does have a width param, but that is limited to an absolute value in cells.

Perhaps you could handle the Resize event to dynamically change the column widths, but it might be nice if the DataTable provided some easier way of handling this!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bjesus
Comment options

Answer selected by bjesus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants