mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-18 21:08:15 +08:00
Add Padding extension
Add extension method for specifying horizontal and vertical padding. Similar constructor for `Padding` already existed. Update documentation for table column appearance (padding). Update `Should_Render_Padded_Object_Correctly_When_Nested_Within_Other_Object` test to use new extension method.
This commit is contained in:

committed by
Patrik Svensson

parent
9915a0d6a8
commit
bca1c889d1
@ -109,12 +109,16 @@ table.Columns[0].RightAligned();
|
||||
## Padding
|
||||
|
||||
```csharp
|
||||
// Set left and right padding
|
||||
table.Columns[0].Padding(left: 3, right: 5);
|
||||
|
||||
// Set padding individually
|
||||
table.Columns[0].PadLeft(3);
|
||||
table.Columns[0].PadRight(5);
|
||||
|
||||
// Or chained together
|
||||
table.Columns[0].PadLeft(3).PadRight(5);
|
||||
|
||||
// Or with the shorthand method if the left and right
|
||||
// padding are identical. Vertical padding is ignored.
|
||||
table.Columns[0].Padding(4, 0);
|
||||
```
|
||||
|
||||
## Disable column wrapping
|
||||
|
Reference in New Issue
Block a user