Format-SpectreGrid
Description
Formats data into a Spectre Console grid. The grid can be used to display data in a tabular format but it’s not as flexible as the Layout widget.
See https://spectreconsole.net/widgets/grid for more information.
Examples
Example 1
This example demonstrates how to display a grid of rows using the Spectre Console module with a list of lists.
Example 2
This example demonstrates how to display a grid of rows using the Spectre Console module with a list of New-SpectreGridRow
objects.
The New-SpectreGridRow
function is used to create the rows when you want to avoid array collapsing in PowerShell turning your rows into a single array of columns.
Parameters
Data
The data to be displayed in the grid. This can be a list of lists or a list of New-SpectreGridRow
objects.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Object] | true | 1 | true (ByValue) |
Width
The width of the grid. If not specified, the grid width will be automatic.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Int32] | false | 2 | false |
Padding
The padding to apply to the grid items. The default is 1.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Int32] | false | 3 | false |