Skip to content

carlosgamezdev/Table

 
 

Repository files navigation

Table

A general abstraction of a Table object

Table is a simple project I created to be used as part of larger projects. It allows me to quickly add an abstraction to use data tables and related functionality.

How to use Table

using EngineersTools;

// Create a new table with
// Title: 'My New Table'
// 4 Rows x 3 Columns
var table = new Table("My New Table", 4, 3);

// Add a header to the fisrt column
table.Columns[1].Header = "First";

// Add text to cell on Row 2, Col 1
table.Cells[2, 1] = "Content 2,1";
// Add a number to cell on Row 1, Col 1 
table.Cells[1, 1] = 67.0m;
// Output the size of the table
Console.WriteLine(table.Size);

SizeOutput

// Output the content of cell Row 1, Col 2
Console.WriteLine(table.Cells[1, 1]);

SingleCellOutput

// Output the table as a string
Console.WriteLine(table.ToString());

ToStringOutput

// Output the table as CSV
Console.WriteLine(table.ToCsv());

ToCsvOutput

// Output the table as JSON
Console.WriteLine(table.ToJson());

ToJsonOutput

About

A general abstraction of a Table object

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%