@@ -242,13 +242,12 @@ func main() {
242242 t := table.New (os.Stdout )
243243
244244 t.SetHeaders (" ID" , " Fruit" , " Stock" )
245- t.SetFooters (" ID" , " Fruit" , " Stock" )
246-
245+ t.SetRowLines (false )
247246 t.AddRow (" 1" , " Apple" , " 14" )
248247 t.AddRow (" 2" , " Banana" , " 88,041" )
249248 t.AddRow (" 3" , " Cherry" , " 342" )
250249 t.AddRow (" 4" , " Dragonfruit" , " 1" )
251-
250+ t. SetFooters ( " " , " Count " , " 4 " )
252251 t.Render ()
253252}
254253
@@ -260,14 +259,11 @@ func main() {
260259│ ID │ Fruit │ Stock │
261260├────┼─────────────┼────────┤
262261│ 1 │ Apple │ 14 │
263- ├────┼─────────────┼────────┤
264262│ 2 │ Banana │ 88,041 │
265- ├────┼─────────────┼────────┤
266263│ 3 │ Cherry │ 342 │
267- ├────┼─────────────┼────────┤
268264│ 4 │ Dragonfruit │ 1 │
269265├────┼─────────────┼────────┤
270- │ ID │ Fruit │ Stock │
266+ │ │ Count │ 4 │
271267└────┴─────────────┴────────┘
272268
273269```
@@ -487,17 +483,17 @@ func main() {
487483
488484#### Output
489485```
490- ┌───────────────────┬────────┬───────────────── ┐
491- │ System │ Status │ Last Check │
492- ├───────────────────┼────────┼───────────────── ┤
493- │ Life Support │ OK │ May 13 17:34:32 │
494- ├───────────────────┤ ├───────────────── ┤
495- │ Nuclear Generator │ │ May 13 17:33:32 │
496- ├───────────────────┼────────┼───────────────── ┤
497- │ Weapons Systems │ FAIL │ May 13 17:34:32 │
498- ├───────────────────┼────────┤ │
499- │ Shields │ OK │ │
500- └───────────────────┴────────┴───────────────── ┘
486+ ┌───────────────────┬────────┬────────────────┐
487+ │ System │ Status │ Last Check │
488+ ├───────────────────┼────────┼────────────────┤
489+ │ Life Support │ OK │ May 2 09:28:05 │
490+ ├───────────────────┤ ├────────────────┤
491+ │ Nuclear Generator │ │ May 2 09:27:05 │
492+ ├───────────────────┼────────┼────────────────┤
493+ │ Weapons Systems │ FAIL │ May 2 09:28:05 │
494+ ├───────────────────┼────────┤ │
495+ │ Shields │ OK │ │
496+ └───────────────────┴────────┴────────────────┘
501497
502498```
503499
@@ -620,6 +616,49 @@ func main() {
620616│ default │ Service/test │ 0 │ 0 │ 0 │ 1 │ 0 │ 3 │ 0 │ 4 │ 9 │ 0 │
621617└───────────┴────────────────┴──────────┴──────┴────────┴─────┴─────────┴──────────┴──────┴────────┴─────┴─────────┘
622618
619+ ```
620+
621+ ### Example: Only Wrap When Needed
622+ ``` go
623+ package main
624+
625+ import (
626+ " os"
627+
628+ " github.com/aquasecurity/table"
629+ )
630+
631+ func main () {
632+
633+ t := table.New (os.Stdout )
634+
635+ t.SetHeaders (" ID" , " Fruit" , " Stock" )
636+
637+ t.AddRow (" 1" , " 01234567890123456789012345678901234567890123456789012345678901234567890123456789" , " 14" )
638+ t.AddRow (" 2" , " Banana" , " 88,041" )
639+ t.AddRow (" 3" , " Cherry" , " 342" )
640+ t.AddRow (" 4" , " Dragonfruit" , " 1" )
641+
642+ t.Render ()
643+ }
644+
645+ ```
646+
647+ #### Output
648+ ```
649+ ┌────┬──────────────────────────────────────────────────────────────┬────────┐
650+ │ ID │ Fruit │ Stock │
651+ ├────┼──────────────────────────────────────────────────────────────┼────────┤
652+ │ 1 │ 01234567890123456789012345678901234567890123456789012345678- │ 14 │
653+ │ │ 901234567890123456789 │ │
654+ ├────┼──────────────────────────────────────────────────────────────┼────────┤
655+ │ 2 │ Banana │ 88,041 │
656+ ├────┼──────────────────────────────────────────────────────────────┼────────┤
657+ │ 3 │ Cherry │ 342 │
658+ ├────┼──────────────────────────────────────────────────────────────┼────────┤
659+ │ 4 │ Dragonfruit │ 1 │
660+ └────┴──────────────────────────────────────────────────────────────┴────────┘
661+
623662```
624663<!-- /eg-->
625664
0 commit comments