ConsoleTableExt 3.3.0
dotnet add package ConsoleTableExt --version 3.3.0
NuGet\Install-Package ConsoleTableExt -Version 3.3.0
<PackageReference Include="ConsoleTableExt" Version="3.3.0" />
paket add ConsoleTableExt --version 3.3.0
#r "nuget: ConsoleTableExt, 3.3.0"
// Install ConsoleTableExt as a Cake Addin #addin nuget:?package=ConsoleTableExt&version=3.3.0 // Install ConsoleTableExt as a Cake Tool #tool nuget:?package=ConsoleTableExt&version=3.3.0
ConsoleTableExt <a href="https://www.nuget.org/packages/ConsoleTableExt/"><img src="https://img.shields.io/nuget/v/ConsoleTableExt.svg?style=flat" /></a>
A library to print out a nicely formatted table in a console application C#
Nuget
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<object>...
- 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<List<object>>
{
new List<object>{ "Sakura Yamamoto", "Support Engineer", "London", 46},
new List<object>{ "Serge Baldwin", "Data Coordinator", "San Francisco", 28, "something else" },
new List<object>{ "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<int, int> {
{ 1, 25 },
{ 2, 25 }
})
.WithTextAlignment(new Dictionary<int, TextAligntment>
{
{2, TextAligntment.Right }
})
.WithCharMapDefinition(new Dictionary<CharMapPositions, char> {
{CharMapPositions.BottomLeft, '=' },
{CharMapPositions.BottomCenter, '=' },
{CharMapPositions.BottomRight, '=' },
{CharMapPositions.BorderTop, '=' },
{CharMapPositions.BorderBottom, '=' },
{CharMapPositions.BorderLeft, '|' },
{CharMapPositions.BorderRight, '|' },
{CharMapPositions.DividerY, '|' },
})
.WithHeaderCharMapDefinition(new Dictionary<HeaderCharMapPositions, char> {
{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);
<img src="https://raw.githubusercontent.com/minhhungit/ConsoleTableExt/master/wiki/Images/demo1.png" style="width: 100%;" />
Check more demo here https://github.com/minhhungit/ConsoleTableExt/blob/master/Src/ConsoleTableApp/Program.cs
<img src="https://raw.githubusercontent.com/minhhungit/ConsoleTableExt/master/wiki/Images/demo.png" style="width: 100%;" />
Char Map Definition
<img src="https://raw.githubusercontent.com/minhhungit/ConsoleTableExt/master/wiki/Images/CharMapPositions.png" style="width: 100%;" />
Header Char Map
<img src="https://raw.githubusercontent.com/minhhungit/ConsoleTableExt/master/wiki/Images/HeaderCharMapPositions.png" style="width: 100%;" />
There are many ways to contribute to ConsoleTableExt, either contribute issue/code directly or buy me a cup of coffee
<a href='https://ko-fi.com/I2I13GAGL' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi4.png?v=2' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
Inspired by
- <a href="https://github.com/khalidabuhakmeh/ConsoleTables">khalidabuhakmeh/ConsoleTables</a>
Product | Versions 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. |
.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. |
-
.NETFramework 3.5
- No dependencies.
-
.NETFramework 4.6
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
NuGet packages (8)
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/EntityFrameworkCore.Taos
EntityFramework, EF Core, ADO.NET, ORM,Stmt,TDengine
|
Version | Downloads | Last updated |
---|---|---|
3.3.0 | 14,136 | 7/18/2024 |
3.2.0 | 67,441 | 7/10/2022 |
3.1.9 | 97,339 | 8/16/2021 |
3.1.7 | 11,407 | 4/20/2021 |
3.1.6 | 1,293 | 4/20/2021 |
3.1.5 | 6,241 | 2/27/2021 |
3.1.4 | 1,527 | 2/21/2021 |
3.1.3 | 1,403 | 2/21/2021 |
3.1.2 | 3,262 | 2/12/2021 |
3.0.0 | 1,798 | 1/30/2021 |
2.0.3 | 16,188 | 8/14/2020 |
2.0.2 | 247,191 | 12/25/2018 |
2.0.1 | 26,928 | 2/13/2018 |
2.0.0 | 2,171 | 2/13/2018 |
1.1.0 | 2,538 | 12/1/2017 |
1.0.0 | 2,087 | 11/28/2017 |
1.0.0-beta9 | 2,059 | 11/23/2017 |
1.0.0-beta19 | 1,840 | 11/28/2017 |
1.0.0-beta14 | 2,108 | 11/26/2017 |
1.0.0-beta13 | 2,027 | 11/26/2017 |
1.0.0-beta10 | 2,049 | 11/23/2017 |
workarround issue 42 https://github.com/minhhungit/ConsoleTableExt/issues/42
"Parameter count mismatch" exception when passing lists of strings