mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 13:28:16 +08:00
Add support for table footers
This commit is contained in:

committed by
Patrik Svensson

parent
c9c0ad733f
commit
03334f693d
@ -60,6 +60,26 @@ namespace Spectre.Console.Rendering
|
||||
/// </summary>
|
||||
HeaderBottomRight,
|
||||
|
||||
/// <summary>
|
||||
/// The top left part of a footer.
|
||||
/// </summary>
|
||||
FooterTopLeft,
|
||||
|
||||
/// <summary>
|
||||
/// The top part of a footer.
|
||||
/// </summary>
|
||||
FooterTop,
|
||||
|
||||
/// <summary>
|
||||
/// The top separator part of a footer.
|
||||
/// </summary>
|
||||
FooterTopSeparator,
|
||||
|
||||
/// <summary>
|
||||
/// The top right part of a footer.
|
||||
/// </summary>
|
||||
FooterTopRight,
|
||||
|
||||
/// <summary>
|
||||
/// The left part of a cell.
|
||||
/// </summary>
|
||||
|
@ -26,6 +26,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => "|",
|
||||
TableBorderPart.CellSeparator => "|",
|
||||
TableBorderPart.CellRight => "|",
|
||||
TableBorderPart.FooterTopLeft => "|",
|
||||
TableBorderPart.FooterTop => "-",
|
||||
TableBorderPart.FooterTopSeparator => "+",
|
||||
TableBorderPart.FooterTopRight => "|",
|
||||
TableBorderPart.FooterBottomLeft => "+",
|
||||
TableBorderPart.FooterBottom => "-",
|
||||
TableBorderPart.FooterBottomSeparator => "+",
|
||||
|
@ -26,6 +26,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => "|",
|
||||
TableBorderPart.CellSeparator => "|",
|
||||
TableBorderPart.CellRight => "|",
|
||||
TableBorderPart.FooterTopLeft => "+",
|
||||
TableBorderPart.FooterTop => "-",
|
||||
TableBorderPart.FooterTopSeparator => "+",
|
||||
TableBorderPart.FooterTopRight => "+",
|
||||
TableBorderPart.FooterBottomLeft => "+",
|
||||
TableBorderPart.FooterBottom => "-",
|
||||
TableBorderPart.FooterBottomSeparator => "+",
|
||||
|
@ -26,6 +26,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => "|",
|
||||
TableBorderPart.CellSeparator => "|",
|
||||
TableBorderPart.CellRight => "|",
|
||||
TableBorderPart.FooterTopLeft => "|",
|
||||
TableBorderPart.FooterTop => "-",
|
||||
TableBorderPart.FooterTopSeparator => "+",
|
||||
TableBorderPart.FooterTopRight => "|",
|
||||
TableBorderPart.FooterBottomLeft => "+",
|
||||
TableBorderPart.FooterBottom => "-",
|
||||
TableBorderPart.FooterBottomSeparator => "-",
|
||||
|
@ -26,6 +26,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => "║",
|
||||
TableBorderPart.CellSeparator => "│",
|
||||
TableBorderPart.CellRight => "║",
|
||||
TableBorderPart.FooterTopLeft => "╟",
|
||||
TableBorderPart.FooterTop => "─",
|
||||
TableBorderPart.FooterTopSeparator => "┼",
|
||||
TableBorderPart.FooterTopRight => "╢",
|
||||
TableBorderPart.FooterBottomLeft => "╚",
|
||||
TableBorderPart.FooterBottom => "═",
|
||||
TableBorderPart.FooterBottomSeparator => "╧",
|
||||
|
@ -26,6 +26,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => "║",
|
||||
TableBorderPart.CellSeparator => "║",
|
||||
TableBorderPart.CellRight => "║",
|
||||
TableBorderPart.FooterTopLeft => "╠",
|
||||
TableBorderPart.FooterTop => "═",
|
||||
TableBorderPart.FooterTopSeparator => "╬",
|
||||
TableBorderPart.FooterTopRight => "╣",
|
||||
TableBorderPart.FooterBottomLeft => "╚",
|
||||
TableBorderPart.FooterBottom => "═",
|
||||
TableBorderPart.FooterBottomSeparator => "╩",
|
||||
|
@ -29,6 +29,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => "┃",
|
||||
TableBorderPart.CellSeparator => "│",
|
||||
TableBorderPart.CellRight => "┃",
|
||||
TableBorderPart.FooterTopLeft => "┠",
|
||||
TableBorderPart.FooterTop => "─",
|
||||
TableBorderPart.FooterTopSeparator => "┼",
|
||||
TableBorderPart.FooterTopRight => "┨",
|
||||
TableBorderPart.FooterBottomLeft => "┗",
|
||||
TableBorderPart.FooterBottom => "━",
|
||||
TableBorderPart.FooterBottomSeparator => "┷",
|
||||
|
@ -29,6 +29,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => "│",
|
||||
TableBorderPart.CellSeparator => "│",
|
||||
TableBorderPart.CellRight => "│",
|
||||
TableBorderPart.FooterTopLeft => "├",
|
||||
TableBorderPart.FooterTop => "─",
|
||||
TableBorderPart.FooterTopSeparator => "┼",
|
||||
TableBorderPart.FooterTopRight => "┤",
|
||||
TableBorderPart.FooterBottomLeft => "└",
|
||||
TableBorderPart.FooterBottom => "─",
|
||||
TableBorderPart.FooterBottomSeparator => "┴",
|
||||
|
@ -29,6 +29,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => "┃",
|
||||
TableBorderPart.CellSeparator => "┃",
|
||||
TableBorderPart.CellRight => "┃",
|
||||
TableBorderPart.FooterTopLeft => "┣",
|
||||
TableBorderPart.FooterTop => "━",
|
||||
TableBorderPart.FooterTopSeparator => "╋",
|
||||
TableBorderPart.FooterTopRight => "┫",
|
||||
TableBorderPart.FooterBottomLeft => "┗",
|
||||
TableBorderPart.FooterBottom => "━",
|
||||
TableBorderPart.FooterBottomSeparator => "┻",
|
||||
|
@ -26,6 +26,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => " ",
|
||||
TableBorderPart.CellSeparator => " ",
|
||||
TableBorderPart.CellRight => " ",
|
||||
TableBorderPart.FooterTopLeft => "─",
|
||||
TableBorderPart.FooterTop => "─",
|
||||
TableBorderPart.FooterTopSeparator => "─",
|
||||
TableBorderPart.FooterTopRight => "─",
|
||||
TableBorderPart.FooterBottomLeft => "─",
|
||||
TableBorderPart.FooterBottom => "─",
|
||||
TableBorderPart.FooterBottomSeparator => "─",
|
||||
|
@ -29,6 +29,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => "|",
|
||||
TableBorderPart.CellSeparator => "|",
|
||||
TableBorderPart.CellRight => "|",
|
||||
TableBorderPart.FooterTopLeft => " ",
|
||||
TableBorderPart.FooterTop => " ",
|
||||
TableBorderPart.FooterTopSeparator => " ",
|
||||
TableBorderPart.FooterTopRight => " ",
|
||||
TableBorderPart.FooterBottomLeft => " ",
|
||||
TableBorderPart.FooterBottom => " ",
|
||||
TableBorderPart.FooterBottomSeparator => " ",
|
||||
@ -40,7 +44,12 @@ namespace Spectre.Console.Rendering
|
||||
/// <inheritdoc/>
|
||||
public override string GetColumnRow(TablePart part, IReadOnlyList<int> widths, IReadOnlyList<IColumn> columns)
|
||||
{
|
||||
if (part != TablePart.Separator)
|
||||
if (part == TablePart.FooterSeparator)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
if (part != TablePart.HeaderSeparator)
|
||||
{
|
||||
return base.GetColumnRow(part, widths, columns);
|
||||
}
|
||||
|
@ -26,6 +26,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => " ",
|
||||
TableBorderPart.CellSeparator => "│",
|
||||
TableBorderPart.CellRight => " ",
|
||||
TableBorderPart.FooterTopLeft => " ",
|
||||
TableBorderPart.FooterTop => "═",
|
||||
TableBorderPart.FooterTopSeparator => "╪",
|
||||
TableBorderPart.FooterTopRight => " ",
|
||||
TableBorderPart.FooterBottomLeft => " ",
|
||||
TableBorderPart.FooterBottom => " ",
|
||||
TableBorderPart.FooterBottomSeparator => " ",
|
||||
|
@ -29,6 +29,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => " ",
|
||||
TableBorderPart.CellSeparator => "│",
|
||||
TableBorderPart.CellRight => " ",
|
||||
TableBorderPart.FooterTopLeft => " ",
|
||||
TableBorderPart.FooterTop => "━",
|
||||
TableBorderPart.FooterTopSeparator => "┿",
|
||||
TableBorderPart.FooterTopRight => " ",
|
||||
TableBorderPart.FooterBottomLeft => " ",
|
||||
TableBorderPart.FooterBottom => " ",
|
||||
TableBorderPart.FooterBottomSeparator => " ",
|
||||
|
@ -26,6 +26,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => " ",
|
||||
TableBorderPart.CellSeparator => "│",
|
||||
TableBorderPart.CellRight => " ",
|
||||
TableBorderPart.FooterTopLeft => " ",
|
||||
TableBorderPart.FooterTop => "─",
|
||||
TableBorderPart.FooterTopSeparator => "┼",
|
||||
TableBorderPart.FooterTopRight => " ",
|
||||
TableBorderPart.FooterBottomLeft => " ",
|
||||
TableBorderPart.FooterBottom => " ",
|
||||
TableBorderPart.FooterBottomSeparator => " ",
|
||||
|
@ -29,6 +29,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => "│",
|
||||
TableBorderPart.CellSeparator => "│",
|
||||
TableBorderPart.CellRight => "│",
|
||||
TableBorderPart.FooterTopLeft => "├",
|
||||
TableBorderPart.FooterTop => "─",
|
||||
TableBorderPart.FooterTopSeparator => "┼",
|
||||
TableBorderPart.FooterTopRight => "┤",
|
||||
TableBorderPart.FooterBottomLeft => "╰",
|
||||
TableBorderPart.FooterBottom => "─",
|
||||
TableBorderPart.FooterBottomSeparator => "┴",
|
||||
|
@ -29,6 +29,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => " ",
|
||||
TableBorderPart.CellSeparator => " ",
|
||||
TableBorderPart.CellRight => " ",
|
||||
TableBorderPart.FooterTopLeft => "━",
|
||||
TableBorderPart.FooterTop => "━",
|
||||
TableBorderPart.FooterTopSeparator => "━",
|
||||
TableBorderPart.FooterTopRight => "━",
|
||||
TableBorderPart.FooterBottomLeft => " ",
|
||||
TableBorderPart.FooterBottom => " ",
|
||||
TableBorderPart.FooterBottomSeparator => " ",
|
||||
|
@ -26,6 +26,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => " ",
|
||||
TableBorderPart.CellSeparator => " ",
|
||||
TableBorderPart.CellRight => " ",
|
||||
TableBorderPart.FooterTopLeft => "─",
|
||||
TableBorderPart.FooterTop => "─",
|
||||
TableBorderPart.FooterTopSeparator => "─",
|
||||
TableBorderPart.FooterTopRight => "─",
|
||||
TableBorderPart.FooterBottomLeft => " ",
|
||||
TableBorderPart.FooterBottom => " ",
|
||||
TableBorderPart.FooterBottomSeparator => " ",
|
||||
|
@ -26,6 +26,10 @@ namespace Spectre.Console.Rendering
|
||||
TableBorderPart.CellLeft => "│",
|
||||
TableBorderPart.CellSeparator => "│",
|
||||
TableBorderPart.CellRight => "│",
|
||||
TableBorderPart.FooterTopLeft => "├",
|
||||
TableBorderPart.FooterTop => "─",
|
||||
TableBorderPart.FooterTopSeparator => "┼",
|
||||
TableBorderPart.FooterTopRight => "┤",
|
||||
TableBorderPart.FooterBottomLeft => "└",
|
||||
TableBorderPart.FooterBottom => "─",
|
||||
TableBorderPart.FooterBottomSeparator => "┴",
|
||||
|
@ -13,7 +13,12 @@ namespace Spectre.Console.Rendering
|
||||
/// <summary>
|
||||
/// The separator between the header and the cells.
|
||||
/// </summary>
|
||||
Separator,
|
||||
HeaderSeparator,
|
||||
|
||||
/// <summary>
|
||||
/// The separator between the footer and the cells.
|
||||
/// </summary>
|
||||
FooterSeparator,
|
||||
|
||||
/// <summary>
|
||||
/// The bottom of a table.
|
||||
|
Reference in New Issue
Block a user