Skip to content

Commit 8e34b11

Browse files
committed
fix read and minor update
1 parent 571d727 commit 8e34b11

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ func main() {
711711
tablewriter.WithStringer(employeeStringer),
712712
tablewriter.WithConfig(tablewriter.Config{
713713
Header: tw.CellConfig{
714-
Formatting: tw.CellFormatting{Alignment: tw.AlignCenter, AutoFormat: true},
714+
Formatting: tw.CellFormatting{Alignment: tw.AlignCenter, AutoFormat: tw.On},
715715
},
716716
Row: tw.CellConfig{
717717
Formatting: tw.CellFormatting{Alignment: tw.AlignLeft},

config.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,12 @@ func WithTrimSpace(state tw.State) Option {
913913
}
914914
}
915915

916+
func WithHeaderAutoFormat(state tw.State) Option {
917+
return func(target *Table) {
918+
target.config.Header.Formatting.AutoFormat = state
919+
}
920+
}
921+
916922
// WithHeaderControl sets the control behavior for the table header.
917923
// Logs the change if debugging is enabled.
918924
func WithHeaderControl(control tw.Control) Option {

stream.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ func (t *Table) streamCalculateWidths(sampleDataLines []string, sectionConfigFor
514514
ellipsisWidthBuffer = tw.DisplayWidth(tw.CharEllipsis)
515515
}
516516
varianceBuffer := 2 // Your suggested variance
517-
minTotalColWidth := tw.DefaultMinlColumnWidth
517+
minTotalColWidth := tw.MinimumColumnWidth
518518
// Example: if t.config.Stream.MinAutoColumnWidth > 0 { minTotalColWidth = t.config.Stream.MinAutoColumnWidth }
519519

520520
for i := 0; i < t.streamNumCols; i++ {

tw/tw.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const (
77
Fail = -1 // Operation failed
88
Success = 1 // Operation succeeded
99

10-
DefaultMinlColumnWidth = 8
10+
MinimumColumnWidth = 8
1111
)
1212

1313
const (

0 commit comments

Comments
 (0)