Format-SpectreColumns
Description
This function creates a spectre columns widget that renders a collection of renderables in autosized columns to the console.
Columns can contain renderable items.
See https://spectreconsole.net/widgets/columns for more information.
Examples
Example 1
This example demonstrates how to display a collection of strings in columns.
@("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit,", "sed", "do", "eiusmod",
"tempor", "incididunt", "ut", "labore", "et", "dolore", "magna", "aliqua.", "Ut", "enim", "ad", "minim",
"veniam,", "quis", "nostrud", "exercitation", "ullamco", "laboris", "nisi", "ut", "aliquip", "ex", "ea",
"commodo", "consequat", "duis", "aute", "irure", "dolor", "in", "reprehenderit", "in", "voluptate", "velit",
"esse", "cillum", "dolore", "eu", "fugiat", "nulla", "pariatur", "excepteur", "sint", "occaecat",
"cupidatat", "non", "proident", "sunt", "in", "culpa") | Foreach-Object { $_ } | Format-SpectreColumns
Example 2
This example demonstrates how to display a collection of panels that are expanded but with normal sized columns.
@("left", "middle", "right") | Foreach-Object { $_ | Format-SpectrePanel -Expand } | Format-SpectreColumns
Example 3
This example demonstrates how to display a collection of panels that are expanded and with expanded columns so it takes up the console width.
@("left", "middle", "right") | Foreach-Object { $_ | Format-SpectrePanel -Expand } | Format-SpectreColumns -Expand
Parameters
Data
An array of objects containing the data to be displayed in the columns.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Object] | true | 1 | true (ByValue) |
Padding
The padding to apply to the columns.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Int32] | false | 2 | false |
Expand
A switch to expand the columns to fill the available space.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Switch] | false | named | false |
Syntax
Format-SpectreColumns [-Data] <Object> [[-Padding] <Int32>] [-Expand] [<CommonParameters>]