Replies: 1 comment
-
I'm afraid that's just how consoles handle output. If we want to output a full width table, for example, we can detect the screen is 90 characters wide the title is 10. So the console "we want 40 = characters then the heading and 40 more = characters". Console renders and it looks fine. But if you resize the window the console doesn't know our intentions when we outputted the characters, so it just tries to fit everything on the screen. In the future we might have support for custom widgets that can be constantly be redrawn which would allow us to react to screensize changes in between rendering as long as the app was in its render loop. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you have a pretty wide table and the console window is smaller then the table it renders nicely like this
But when i resize the console window to fit the content the whole table gets destroyed like this
Is there a way to redraw the table or is there something i have missed?
AnsiConsole.Render(new Table() .Border(TableBorder.DoubleEdge) .Title("TABLE [yellow]TITLE[/]") .Caption("TABLE [yellow]CAPTION[/]") .AddColumn(new TableColumn(new Panel("[u]ABC[/]").BorderColor(Color.Red)).Footer("[u]FOOTER 1[/]")) .AddColumn(new TableColumn(new Panel("[u]DEF[/]").BorderColor(Color.Green)).Footer("[u]FOOTER 2[/]")) .AddColumn(new TableColumn(new Panel("[u]GHI[/]").BorderColor(Color.Blue)).Footer("[u]FOOTER 3[/]")) .AddColumn(new TableColumn(new Panel("[u]GHI[/]").BorderColor(Color.Blue)).Footer("[u]FOOTER 3[/]")) .AddRow( new Text("747c5abe-3d97-49eb-8f36-4e81f8edd401"), new Text("747c5abe-3d97-49eb-8f36-4e81f8edd401"), new Text("747c5abe-3d97-49eb-8f36-4e81f8edd401"), new Text("747c5abe-3d97-49eb-8f36-4e81f8edd401")) );
BTW thnx for this awesome library!
Beta Was this translation helpful? Give feedback.
All reactions