mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-12-29 20:05:48 +08:00
committed by
Patrik Svensson
parent
1cf30f62fc
commit
7dccb310f3
@@ -97,5 +97,22 @@ namespace Spectre.Console
|
||||
grid.AddRow(columns.Select(column => new Markup(column)).ToArray());
|
||||
return grid;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the grid width.
|
||||
/// </summary>
|
||||
/// <param name="grid">The grid.</param>
|
||||
/// <param name="width">The width.</param>
|
||||
/// <returns>The same instance so that multiple calls can be chained.</returns>
|
||||
public static Grid Width(this Grid grid, int? width)
|
||||
{
|
||||
if (grid is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(grid));
|
||||
}
|
||||
|
||||
grid.Width = width;
|
||||
return grid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user