-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add options and methods for setting column widths
- Loading branch information
1 parent
b8b575f
commit 76feed6
Showing
3 changed files
with
431 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/KimNorgaard/tablr" | ||
) | ||
|
||
func main() { | ||
// Create a new table with two columns | ||
// First column has a minimum width of 20 characters | ||
table := tablr.New(os.Stdout, []string{"Name", "Age"}, | ||
tablr.WithMinColumnWidth(0, 20)) | ||
|
||
// Add some rows | ||
table.AddRow([]string{"John Doe", "30"}) | ||
table.AddRow([]string{"Jane Doe", "25"}) | ||
|
||
// Render the table | ||
table.Render() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.