Repository: pterm/pterm (go)

Issue:
Add Frame around Table
As a user, I would like to print a border around my Table. I'm assuming I can do that with a Box at the moment, through some hackery, but it's not immediately obvious how to do that, and a setting on `Table` would make it much more convenient. 

Pull request description:
feat(table): add `Boxed` option
### Description
Add an option to the `TablePrinter`, which adds a box around it.

### Scope
> What is affected by this pull request?

- [ ] Bug Fix
- [x] New Feature
- [ ] Documentation
- [ ] Other

### Related Issue
Fixes #225 


### To-Do Checklist
- [x] I tested my changes
- [ ] I have commented every method that I created/changed
- [ ] I updated the examples to fit with my changes
- [x] I have added tests for my newly created methods


Patch:
diff --git a/table_printer.go b/table_printer.go
index 16907e1e..747b3f8a 100644
--- a/table_printer.go
+++ b/table_printer.go
@@ -27,6 +27,7 @@ type TablePrinter struct {
 	Separator      string
 	SeparatorStyle *Style
 	Data           TableData
+	Boxed          bool
 }
 
 // WithStyle returns a new TablePrinter with a specific Style.
@@ -73,6 +74,12 @@ func (p TablePrinter) WithCSVReader(reader *csv.Reader) *TablePrinter {
 	return &p
 }
 
+// WithBoxed returns a new TablePrinter with a box around the table.
+func (p TablePrinter) WithBoxed(b ...bool) *TablePrinter {
+	p.Boxed = internal.WithBoolean(b)
+	return &p
+}
+
 // Srender renders the TablePrinter as a string.
 func (p TablePrinter) Srender() (string, error) {
 	if p.Style == nil {
@@ -118,6 +125,10 @@ func (p TablePrinter) Srender() (string, error) {
 
 	ret = strings.TrimSuffix(ret, "\n")
 
+	if p.Boxed {
+		ret = DefaultBox.Sprint(ret)
+	}
+
 	return ret, nil
 }
 


Test patch:
diff --git a/table_printer_test.go b/table_printer_test.go
index 6f4aa3d1..bff10910 100644
--- a/table_printer_test.go
+++ b/table_printer_test.go
@@ -30,6 +30,13 @@ func TestTablePrinter_WithCSVReader(t *testing.T) {
 	p2.Srender()
 }
 
+func TestTablePrinter_WithBoxed(t *testing.T) {
+	_, err := DefaultTable.WithBoxed().Srender()
+	if err != nil {
+		t.Error(err)
+	}
+}
+
 func TestTablePrinter_WithData(t *testing.T) {
 	proxyToDevNull()
 	d := TableData{