mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 10:35:27 +08:00 
			
		
		
		
	Add row and column accessors for tables and grids
This commit is contained in:
		
				
					committed by
					
						
						Patrik Svensson
					
				
			
			
				
	
			
			
			
						parent
						
							3e5e22d6c2
						
					
				
				
					commit
					e7f497050c
				
			@@ -91,33 +91,33 @@ table.Width(50);
 | 
			
		||||
## Alignment
 | 
			
		||||
 | 
			
		||||
```csharp
 | 
			
		||||
column.Alignment(Justify.Right);
 | 
			
		||||
column.LeftAligned();
 | 
			
		||||
column.Centered();
 | 
			
		||||
column.RightAligned();
 | 
			
		||||
table.Columns[0].Alignment(Justify.Right);
 | 
			
		||||
table.Columns[0].LeftAligned();
 | 
			
		||||
table.Columns[0].Centered();
 | 
			
		||||
table.Columns[0].RightAligned();
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Padding
 | 
			
		||||
 | 
			
		||||
```csharp
 | 
			
		||||
// Set left and right padding
 | 
			
		||||
column.Padding(left: 3, right: 5);
 | 
			
		||||
table.Columns[0].Padding(left: 3, right: 5);
 | 
			
		||||
 | 
			
		||||
// Set padding individually.
 | 
			
		||||
column.PadLeft(3);
 | 
			
		||||
column.PadRight(5);
 | 
			
		||||
// Set padding individually
 | 
			
		||||
table.Columns[0].PadLeft(3);
 | 
			
		||||
table.Columns[0].PadRight(5);
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Disable column wrapping
 | 
			
		||||
 | 
			
		||||
```csharp
 | 
			
		||||
// Disable column wrapping
 | 
			
		||||
column.NoWrap();
 | 
			
		||||
table.Columns[0].NoWrap();
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Set column width
 | 
			
		||||
 | 
			
		||||
```csharp
 | 
			
		||||
// Set the column width (no fluent extension method for this yet)
 | 
			
		||||
column.Width = 15;
 | 
			
		||||
// Set the column width
 | 
			
		||||
table.Columns[0].Width(15);
 | 
			
		||||
```
 | 
			
		||||
		Reference in New Issue
	
	Block a user