@@ -418,23 +418,23 @@ func TestLongValues(t *testing.T) {
418418 c := tablewriter.Config {
419419 Header : tw.CellConfig {
420420 Formatting : tw.CellFormatting {
421- Alignment : tw .AlignCenter ,
422421 AutoFormat : tw .On ,
423422 },
423+ Alignment : tw.CellAlignment {Global : tw .AlignCenter },
424424 ColMaxWidths : tw.CellWidth {Global : 30 },
425425 },
426426 Row : tw.CellConfig {
427427 Formatting : tw.CellFormatting {
428- AutoWrap : tw .WrapNormal ,
429- Alignment : tw .AlignLeft ,
428+ AutoWrap : tw .WrapNormal ,
430429 },
430+ Alignment : tw.CellAlignment {Global : tw .AlignLeft },
431431 ColMaxWidths : tw.CellWidth {Global : 30 },
432432 },
433433 Footer : tw.CellConfig {
434- Formatting : tw.CellFormatting {
435- Alignment : tw .AlignRight ,
434+ Alignment : tw.CellAlignment {
435+ Global : tw .AlignRight ,
436+ PerColumn : []tw.Align {tw .Skip , tw .Skip , tw .Skip , tw .AlignLeft },
436437 },
437- ColumnAligns : []tw.Align {tw .Skip , tw .Skip , tw .Skip , tw .AlignLeft },
438438 },
439439 }
440440
@@ -487,21 +487,19 @@ func TestWrapping(t *testing.T) {
487487 c := tablewriter.Config {
488488 Header : tw.CellConfig {
489489 Formatting : tw.CellFormatting {
490- Alignment : tw .AlignCenter ,
491490 AutoFormat : tw .On ,
492491 },
492+ Alignment : tw.CellAlignment {Global : tw .AlignCenter },
493493 },
494494 Row : tw.CellConfig {
495495 Formatting : tw.CellFormatting {
496- AutoWrap : tw .WrapBreak ,
497- Alignment : tw .AlignLeft ,
496+ AutoWrap : tw .WrapBreak ,
498497 },
498+ Alignment : tw.CellAlignment {Global : tw .AlignLeft },
499499 ColMaxWidths : tw.CellWidth {Global : 33 },
500500 },
501501 Footer : tw.CellConfig {
502- Formatting : tw.CellFormatting {
503- Alignment : tw .AlignRight ,
504- },
502+ Alignment : tw.CellAlignment {Global : tw .AlignRight },
505503 ColMaxWidths : tw.CellWidth {Global : 30 },
506504 },
507505 }
@@ -537,26 +535,24 @@ func TestTableWithCustomPadding(t *testing.T) {
537535 c := tablewriter.Config {
538536 Header : tw.CellConfig {
539537 Formatting : tw.CellFormatting {
540- Alignment : tw .AlignCenter ,
541538 AutoFormat : tw .On ,
542539 },
540+ Alignment : tw.CellAlignment {Global : tw .AlignCenter },
543541 Padding : tw.CellPadding {
544542 Global : tw.Padding {Left : " " , Right : " " , Top : "^" , Bottom : "^" },
545543 },
546544 },
547545 Row : tw.CellConfig {
548- Formatting : tw.CellFormatting {
549- Alignment : tw .AlignCenter ,
550- },
546+ Alignment : tw.CellAlignment {Global : tw .AlignCenter },
551547 Padding : tw.CellPadding {
552548 Global : tw.Padding {Left : "L" , Right : "R" , Top : "T" , Bottom : "B" },
553549 },
554550 },
555551 Footer : tw.CellConfig {
556552 Formatting : tw.CellFormatting {
557- Alignment : tw .AlignCenter ,
558553 AutoFormat : tw .On ,
559554 },
555+ Alignment : tw.CellAlignment {Global : tw .AlignCenter },
560556 Padding : tw.CellPadding {
561557 Global : tw.Padding {Left : "*" , Right : "*" , Top : "" , Bottom : "" },
562558 },
@@ -653,7 +649,11 @@ C │ D
653649 },
654650 )
655651 st := tablewriter .NewTable (& buf ,
656- tablewriter .WithConfig (tablewriter.Config {Row : tw.CellConfig {Formatting : tw.CellFormatting {Alignment : tw .AlignLeft }}, Widths : tw.CellWidth {PerColumn : widths }}),
652+ tablewriter .WithConfig (tablewriter.Config {
653+ Row : tw.CellConfig {
654+ Alignment : tw.CellAlignment {Global : tw .AlignLeft },
655+ },
656+ Widths : tw.CellWidth {PerColumn : widths }}),
657657 tablewriter .WithRenderer (r ),
658658 tablewriter .WithDebug (false ),
659659 tablewriter .WithStreaming (tw.StreamConfig {Enable : true }),
@@ -784,7 +784,7 @@ func TestAlignmentMigration(t *testing.T) {
784784 buf .Reset ()
785785 table := tablewriter .NewTable (buf )
786786 table .Configure (func (cfg * tablewriter.Config ) {
787- cfg .Footer .Formatting . Alignment = tw .AlignRight
787+ cfg .Footer .Alignment . Global = tw .AlignRight
788788 cfg .Stream .Enable = true
789789 })
790790 table .Start ()
@@ -809,5 +809,4 @@ func TestAlignmentMigration(t *testing.T) {
809809 t .Fatal ("StreamBasic rendering failed" )
810810 }
811811 })
812-
813812}
0 commit comments