You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Minimal format but with spaces between the columns #34
But what I found was if both BottomCenter and Divider are spaces (' '), then the space is collapsed between the two of them which squishes the columns together. I ended up needing to put something between the two to make it work:
Adding that adds extra columns to the right and left of the headers, which isn't ideal but workable. But, being able to have spaces between the columns would be greatly appreciated. Is there a way of doing that?
Not sure I understand your question, are you asking about 2 bellow char
you can set column padding (space left and right of column) using WithPaddingLeft and WithPaddingRight
another option I think you can config Header Char Map for TopLeft, ``BorderLeft, BottomLeft and `TopRight`, `BorderRight`, and `BottomRight` to empty string using `.WithHeaderCharMapDefinition`
Thank you, that covers one of the two questions. The other is the space divider between columns without having padding. In a unit test, this is what I expected would work but didn't.
[Test]
public void DefaultFormatWithDataTable()
{
var strBuilder =
ConsoleTableBuilder
.From(SampleData.SampleTableData)
.WithPaddingLeft(string.Empty)
.WithPaddingRight(string.Empty)
.WithCharMapDefinition(
new Dictionary<CharMapPositions, char>
{
{ CharMapPositions.DividerY, ' ' },
})
.WithHeaderCharMapDefinition(
new Dictionary<HeaderCharMapPositions, char>
{
{ HeaderCharMapPositions.BottomCenter, ' ' },
{ HeaderCharMapPositions.Divider, ' ' },
{ HeaderCharMapPositions.BorderBottom, '-' },
});
.Export();
Assert.IsTrue(strBuilder.ToString() == @"Name Position Office Age Start Date
-------------- ----------------------------- ------------- --- ---------------------
Airi Satou Accountant Tokyo 33 5/9/2017 12:00:00 AM
Angelica Ramos Chief Executive Officer (CEO) New York 47 1/12/2017 12:00:00 AM
Ashton Cox Junior Technical Author London 46 4/2/2017 12:00:00 AM
Bradley Greer Software Engineer San Francisco 28 11/15/2017 12:00:00 AM
");
var lines = strBuilder.ToString().Split('\n');
Assert.IsTrue(lines.Length == 7);
}
Activity
minhhungit commentedon Sep 12, 2021
Not sure I understand your question, are you asking about 2 bellow char

you can set column padding (space left and right of column) using
WithPaddingLeftandWithPaddingRightanother option I think you can config Header Char Map for
TopLeft, ``BorderLeft,BottomLeftand `TopRight`, `BorderRight`, and `BottomRight` to empty string using `.WithHeaderCharMapDefinition`dmoonfire commentedon Sep 12, 2021
Thank you, that covers one of the two questions. The other is the space divider between columns without having padding. In a unit test, this is what I expected would work but didn't.
It appears that when I have this:
It collapses the divider space entirely instead of giving me a blank line. So I get this divider:
If I change the above BottomCenter to
'+', I still get the divider space:I would like to know how I could get that unit test output (I might be off on the dashes though on the header).
minhhungit commentedon Sep 13, 2021
It's because it has fallback from
CharMapDefinition, but char onCharMapDefinitionis emptyI will try to open a toggle to block the fallback