spectre.console
spectre.console copied to clipboard
Allow a single row or header to span multiple columns in tables
In some cases, it would be useful to have the ability to have a single header or row span multiple columns in a table.
For instance, if the header of the table is used as a title instead of the value name of each column, or if a row has the same value for multiple columns next to each other or even if the row is more used as a separator.
@AdmiringWorm Great idea!
I'm trying to keep functionality simple for now until things stabilized a bit (still some basic features that's missing), so we should probably wait with this for a little while.
@AdmiringWorm As a workaround for now (for table titles), you could configure the Table to not show the column headers, and then draw the title above the table.
var table = new Table(showHeaders: false);
Thanks, I gave that a shot as well. Not as clean, but workable IMO.
Used a panel for the header though (with fit set to true), also had to wrap the table inside a panel with fit set to true, and no border. (Everything was set to Justify.Center as well, as I felt that looked the best)
Otherwise, everything unfortunately looked out of place.
I'm trying to keep functionality simple for now until things stabilized a bit (still some basic features that's missing), so we should probably wait with this for a little while.
I completely understand.
@AdmiringWorm Thanks for understanding.
I'm currently fixing the calculation of table widths and similar so keeping the code simple until everything is working as expected keeps things easier to reason about. Will definitely make panels and tables more flexible in 0.7.0 (which will enable you to remove the hack).
Sounds awesome.
TBH, I kinda like the look the workaround created (the only thing remaining of the look is the center the cells, but that is a different story).

I am testing Spectre.Console on an old program I wrote to help calculate best overclocking in a game I used to play (just in case you were wondering about the output) 😄
That looks really good! Wow! Nice work! Will add an option to add a table header for you in version 0.7! 😄
It is sad that this great library doesn't have the ability to span several columns :( For example: I'd like to add one table into the other one. I can do it, but the child table is rendered in the first column of the row. Because of that it looks unreadable and doesn't make sense...
I've added the help-wanted tag to this. It's be a nice feature to have but not one that I have a need for either so I doubt I'd be able to spend time on myself. Hopefully someone in the community with the need can jump in.
With the testing being very complete around the tables it would be a nice item for someone who hasn't worked in the project before to get their feet wet.
I'd be happy to help with the initial design of the API and code review too.
It is sad that this great library doesn't have the ability to span several columns :( For example: I'd like to add one table into the other one. I can do it, but the child table is rendered in the first column of the row. Because of that it looks unreadable and doesn't make sense...
Hi @dvygolov - Are you able to share in a Gist (or otherwise), an example program.cs that exactly reproduces this issue for you? It would be a really helpful starting point for someone looking to pick up this issue.