ZimLabs.TableCreator
1.4.0
See the version list below for details.
dotnet add package ZimLabs.TableCreator --version 1.4.0
NuGet\Install-Package ZimLabs.TableCreator -Version 1.4.0
<PackageReference Include="ZimLabs.TableCreator" Version="1.4.0" />
paket add ZimLabs.TableCreator --version 1.4.0
#r "nuget: ZimLabs.TableCreator, 1.4.0"
// Install ZimLabs.TableCreator as a Cake Addin #addin nuget:?package=ZimLabs.TableCreator&version=1.4.0 // Install ZimLabs.TableCreator as a Cake Tool #tool nuget:?package=ZimLabs.TableCreator&version=1.4.0
ZimLabs.TableCreator
This library is not very special 😃 It takes a list of objects and creates an ASCII "table", markdown table or a CSV list. Very simple and straight forward.
Content
Install
PM > Install-Package ZimLabs.TableCreator
Usage
Attributes:
internal sealed class Person
{
[Appearance(TextAlign = TextAlign.Right, Order = 1)]
public int Id { get; set; }
[Appearance(Name = "First name", Order = 3)]
public string Name { get; set; }
[Appearance(Order = 2)]
public string LastName { get; set; }
[Appearance(Name = "E-Mail", Order = 4)]
public string Mail { get; set; }
[Appearance(Ignore = true)]
public string Gender { get; set; }
[Appearance(Name = "Job title")]
public string JobTitle { get; set; }
[Appearance(Format = "yyyy-MM-dd")]
public DateTime Birthday { get; set; }
}
Note: If not all properties have an Order value, the following order is applied:
- occurrence in the class
- order according to Order value
Usage of the Create / Save methods:
var personList = CreateDummyList().ToList();
// Print the complete list
Console.WriteLine("Person List");
Console.WriteLine(personList.CreateTable());
// Save the person list
personList.SaveTable("PersonList.txt");
// Print a single person
var person = personList.FirstOrDefault();
Console.WriteLine("Single person");
Console.WriteLine("Value list");
Console.WriteLine(person.CreateValueList());
Console.WriteLine("Value table");
Console.WriteLine(person.CreateValueTable());
// Save the person (as value list)
person.SaveValue("FileName.txt");
// Save the person (as table)
person.SaveValueAsTable("FileName.txt");
Console.WriteLine("Done");
Console.ReadLine();
The result:
Person List
+-------------------------------+------------+----+-------------+------------+-------------------------------+
| Job title | Birthday | Id | LastName | First name | E-Mail |
+-------------------------------+------------+----+-------------+------------+-------------------------------+
| Environmental Tech | 1968-03-26 | 1 | Giblin | Tommy | tgiblin0@amazon.co.uk |
| Teacher | 1952-04-24 | 2 | Puden | Sven | spuden1@soundcloud.com |
| VP Quality Control | 1965-04-10 | 3 | Czaple | Garvy | gczaple2@com.com |
| Pharmacist | 1986-07-23 | 4 | Mariotte | Eryn | emariotte3@issuu.com |
| Senior Financial Analyst | 1967-11-09 | 5 | Oiseau | Zaccaria | zoiseau4@huffingtonpost.com |
+-------------------------------+------------+----+-------------+------------+-------------------------------+
Single person
Value list
- Job title.: Environmental Tech
- Birthday..: 26/03/1968 00:00:00
- Id........: 1
- LastName..: Giblin
- First name: Tommy
- E-Mail....: tgiblin0@amazon.co.uk
Value table
+------------+-----------------------+
| Key | Value |
+------------+-----------------------+
| Job title | Environmental Tech |
| Birthday | 26/03/1968 00:00:00 |
| Id | 1 |
| LastName | Giblin |
| First name | Tommy |
| E-Mail | tgiblin0@amazon.co.uk |
+------------+-----------------------+
Known issues
Currently it's possible to call the methods for a single entry with a list:
// Wrong call
personList.CreateValueList();
This call will cause a System.Reflection.TargetParameterCountException
.
I'll try to fix the bug in the next version (1.4).
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. 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. |
.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 | 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. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
3.0.0 | 42 | 2/14/2025 | |
2.1.1 | 1,326 | 2/25/2024 | |
2.1.0 | 211 | 12/15/2023 | |
2.0.2 | 245 | 9/15/2023 | |
2.0.1 | 323 | 4/27/2023 | |
2.0.0 | 211 | 4/27/2023 | |
1.5.0 | 597 | 3/19/2023 | |
1.4.1 | 356 | 2/5/2023 | |
1.4.0 | 282 | 2/5/2023 | |
1.3.1 | 6,526 | 1/21/2022 | |
1.3.0 | 511 | 1/19/2022 | |
1.2.4 | 333 | 12/29/2021 | |
1.2.3 | 339 | 12/29/2021 | |
1.2.2 | 359 | 12/29/2021 | |
1.2.1 | 392 | 10/29/2021 | |
1.2.0 | 463 | 5/8/2021 | |
1.1.2 | 383 | 5/8/2021 | |
1.1.1 | 461 | 12/23/2020 | |
1.1.0 | 446 | 12/11/2020 | |
1.0.1 | 445 | 11/19/2020 | |
1.0.0 | 655 | 10/31/2020 |
- Added the option to change the delimiter of CSV and add the row number