Is it possible to fit a DataTable to the container? #1942
-
Hello folks, First, I want to congratulate you all, you are doing a great job, I'm developing the version 2 of kaskade https://github.com/sauljabin/kaskade/tree/v2 (please visit it, and let me know your feedback). I have drastically reduced the amount of code using the newer textual release, and that is really great. I'm eager to have Tabs and TextAreas (I'm waiting for them, for a couple of new functionalities I'll add to kaskade). I bring a question related to DataTables, I would like to know if it is possible to set an attribute that allows a DataTable to fit to the container, I have this: But with bigger windows it looks like this: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Looks great! Love that you have tweaked the colors. You might want to add the number cells as We will have flexible columns at some point. And the column header bar will stretch to the full width in the next update. Tabs and Textareas are coming too! |
Beta Was this translation helpful? Give feedback.
-
I needed the same thing, more or less.
I am adding a new property to the object DataTable. I achieve it by adding this line of code in the init of my App
such that I don't change the original API Then I work out the current size of the DataTable and take percentages of the width. I know it's not the best way to code it, but it's a workaround that is doing its job for what I need. |
Beta Was this translation helpful? Give feedback.
Looks great! Love that you have tweaked the colors.
You might want to add the number cells as
Text(str(number), justify="right")
We will have flexible columns at some point. And the column header bar will stretch to the full width in the next update.
Tabs and Textareas are coming too!