ConsoleTableExt 3.3.0

dotnet add package ConsoleTableExt --version 3.3.0
                    
NuGet\Install-Package ConsoleTableExt -Version 3.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.

                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.

                    
Directory.Packages.props

                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ConsoleTableExt --version 3.3.0
                    
#r "nuget: ConsoleTableExt, 3.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ConsoleTableExt@3.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ConsoleTableExt&version=3.3.0
                    
Install as a Cake Addin
#tool nuget:?package=ConsoleTableExt&version=3.3.0
                    
Install as a Cake Tool

ConsoleTableExt Build status

A library to print out a nicely formatted table in a console application C#

Nuget

https://www.nuget.org/packages/ConsoleTableExt/

Feature

  • Support box-drawing characters
  • Table alignment (left right and center)
  • Column alignment (left/right/center)
  • Table can have TITLE, can change text color and background color of title, support title alignment (left/right/center)
  • Support power char-map, strong customization ability
  • Contain some popular formas like Markdown table...
  • Support text formatter (include header)
  • Support many kind data type: DataTable, List...
  • Support metadata row (placed at top or bottom of table)
  • Column min-length
  • support .NET Framework >= 3.5, .NET core
  • ...
  • How to use:

    var tableData = new List>
    {
        new List{ "Sakura Yamamoto", "Support Engineer", "London", 46},
        new List{ "Serge Baldwin", "Data Coordinator", "San Francisco", 28, "something else" },
        new List{ "Shad Decker", "Regional Director", "Edinburgh"},
    };
    
    

    Simple example with default format:

    ConsoleTableBuilder
        .From(tableData)
        .ExportAndWriteLine();
    

    More example with existing format Alternative:

    ConsoleTableBuilder
        .From(tableData)
        .WithFormat(ConsoleTableBuilderFormat.Alternative)
        .ExportAndWriteLine(TableAligntment.Center);
    

    Advance example with custom format using CharMap:

    ConsoleTableBuilder
        .From(tableData)
        .WithTitle("CONTACTS ", ConsoleColor.Yellow, ConsoleColor.DarkGray)
        .WithColumn("Id", "First Name", "Sur Name")
        .WithMinLength(new Dictionary {
            { 1, 25 },
            { 2, 25 }
        })
        .WithTextAlignment(new Dictionary
        {
            {2, TextAligntment.Right }
        })
        .WithCharMapDefinition(new Dictionary {
            {CharMapPositions.BottomLeft, '=' },
            {CharMapPositions.BottomCenter, '=' },
            {CharMapPositions.BottomRight, '=' },
            {CharMapPositions.BorderTop, '=' },
            {CharMapPositions.BorderBottom, '=' },
            {CharMapPositions.BorderLeft, '|' },
            {CharMapPositions.BorderRight, '|' },
            {CharMapPositions.DividerY, '|' },
        })
        .WithHeaderCharMapDefinition(new Dictionary {
            {HeaderCharMapPositions.TopLeft, '=' },
            {HeaderCharMapPositions.TopCenter, '=' },
            {HeaderCharMapPositions.TopRight, '=' },
            {HeaderCharMapPositions.BottomLeft, '|' },
            {HeaderCharMapPositions.BottomCenter, '-' },
            {HeaderCharMapPositions.BottomRight, '|' },
            {HeaderCharMapPositions.Divider, '|' },
            {HeaderCharMapPositions.BorderTop, '=' },
            {HeaderCharMapPositions.BorderBottom, '-' },
            {HeaderCharMapPositions.BorderLeft, '|' },
            {HeaderCharMapPositions.BorderRight, '|' },
        })
        .ExportAndWriteLine(TableAligntment.Right);
    

    Check more demo here https://github.com/minhhungit/ConsoleTableExt/blob/master/Src/ConsoleTableApp/Program.cs

    Char Map Definition

    Header Char Map

    There are many ways to contribute to ConsoleTableExt, either contribute issue/code directly or buy me a cup of coffee

    Buy Me a Coffee at ko-fi.com

    Inspired by

    Product Compatible and additional computed target framework versions.
    .NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
    .NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
    .NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
    .NET Framework net35 is compatible.  net40 was computed.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 is compatible.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
    MonoAndroid monoandroid was computed. 
    MonoMac monomac was computed. 
    MonoTouch monotouch was computed. 
    Tizen tizen40 was computed.  tizen60 was computed. 
    Xamarin.iOS xamarinios was computed. 
    Xamarin.Mac xamarinmac was computed. 
    Xamarin.TVOS xamarintvos was computed. 
    Xamarin.WatchOS xamarinwatchos was computed. 
    Compatible target framework(s)
    Included target framework(s) (in package)
    Learn more about Target Frameworks and .NET Standard.
    • .NETFramework 3.5

      • No dependencies.
    • .NETFramework 4.6

      • No dependencies.
    • .NETStandard 2.0

      • No dependencies.

    NuGet packages (9)

    Showing the top 5 NuGet packages that depend on ConsoleTableExt:

    Package Downloads
    dotnet-fbit

    FeatureBits is a feature toggling system meant to support multiple platforms.

    Documents.Clients.Tools

    Package Description

    Arlown.Tomato

    Arlown.Tomato Desc

    Ubiquitous.AutoDevOps.Automation

    GitLab AutoDevOps implementation with Pulumi

    Frank.Testing.TestOutputExtensions

    Extends ITestOutputHelper to allow output of a generic type using a serializer.

    GitHub repositories (2)

    Showing the top 2 popular GitHub repositories that depend on ConsoleTableExt:

    Repository Stars
    CHKZL/DDTV
    可对阿B进行直播多窗口观看、开播提醒、自动录制、合并、转码的跨平台工具
    IoTSharp/TaosConnector
    ADO.NET, ORM,Stmt,TDengine
    Version Downloads Last Updated
    3.3.0 412,762 7/18/2024
    3.2.0 147,216 7/10/2022
    3.1.9 106,517 8/16/2021
    3.1.7 13,624 4/20/2021
    3.1.6 1,517 4/20/2021
    3.1.5 6,836 2/27/2021
    3.1.4 1,801 2/21/2021
    3.1.3 1,666 2/21/2021
    3.1.2 3,712 2/12/2021
    3.0.0 2,059 1/30/2021
    2.0.3 20,500 8/14/2020
    2.0.2 261,756 12/25/2018
    2.0.1 37,947 2/13/2018
    2.0.0 2,801 2/13/2018
    1.1.0 3,089 12/1/2017
    Loading failed

    workarround issue 42 https://github.com/minhhungit/ConsoleTableExt/issues/42
    "Parameter count mismatch" exception when passing lists of strings