Convert a strongly typed enumerable to a markdown table
$ dotnet add package LSL.Enumerables.MarkdownTablesThis library provides methods to generate a markdown table from a strongly typed IEnumerable<T>
The following example uses all the defaults:
var result = new List<KeyValuePair<string, string>>
{
new("Key1", "Value1"),
new("Key2", "Value2"),
new("Key3", null)
}.ToMarkdownTable();
/* result will contain:
| Key | Value |
| :---- | :------ |
| Key1 | Value1 |
| Key2 | Value2 |
| Key3 | `null` |
*/
DateTime and DateTimeOffset properties use the G format string (e.g. en-GB would show 20/02/2020 23:00:00 for 20th Feb 2020 at 11PM)
d format string is used to only output the date.N2 format string (e.g. en-GB would show 2,123.22 for a decimal value of 2123.22)
N0 format stringnull values will be output as `null`More in-depth documentation can be found
<!-- END:HIDE -->