You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow a single row or header to span multiple columns in tables #24
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.
Please upvote 👍 this issue if you are interested in it.
Reacted by KoalaBear84, Davide Piccinini, shiloh, Alex Vincent and Tom--
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.
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'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).
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) 😄
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.
Hi everyone — I’d love to take this on and work on a fix. If nobody else is actively working on it, I can start investigating this.
Approach: Add colSpan support for body-row cells and update the row layout logic to account for spanned cells (skipping the covered columns so subsequent cells render in the correct positions).
Example (order list)
In an order table with columns Item | Qty | Unit Price | Total, we can show the item name normally, but have a note take the space of the pricing columns:
| Item | Qty | Unit Price | Total
| Item A | 5 | 20 | 100
| Item B | Note: deliver after 5pm (spans Qty + Unit Price + Total) |
Activity
patriksvensson commentedon Aug 6, 2020
@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.
patriksvensson commentedon Aug 6, 2020
@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.
AdmiringWorm commentedon Aug 6, 2020
Thanks, I gave that a shot as well. Not as clean, but workable IMO.
Used a panel for the header though (with
fitset totrue), 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 completely understand.
patriksvensson commentedon Aug 6, 2020
@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).
AdmiringWorm commentedon Aug 6, 2020
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.Consoleon 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) 😄patriksvensson commentedon Aug 6, 2020
That looks really good! Wow! Nice work!
Will add an option to add a table header for you in version 0.7! 😄
dvygolov commentedon Jul 26, 2021
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...
phil-scott-78 commentedon Jul 27, 2021
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.
FrankRay78 commentedon Dec 18, 2022
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.
thomastv commentedon Feb 21, 2026
Hi everyone — I’d love to take this on and work on a fix. If nobody else is actively working on it, I can start investigating this.
Approach: Add
colSpansupport for body-row cells and update the row layout logic to account for spanned cells (skipping the covered columns so subsequent cells render in the correct positions).Example (order list)
In an order table with columns Item | Qty | Unit Price | Total, we can show the item name normally, but have a note take the space of the pricing columns:
patriksvensson commentedon Feb 21, 2026
@thomastv Sure! Go ahead 🙂
Added column spanning support for table body rows (spectreconsole#24)
Added column spanning support for table body rows (#24) (#2020)
Added column spanning support for table body rows (spectreconsole#24) (…