@@ -17,7 +17,7 @@ type Table struct {
1717 renderer Renderer
1818 borderStyle BorderStyle
1919 borderConfig TableBorderConfig
20- align bool // If false, skip alignment for all columns
20+ autoAlign bool // If false, skip alignment for all columns
2121 borders map [string ]string
2222 padding int
2323 headerStyle HeaderStyle // styling for header row
@@ -28,9 +28,9 @@ func (t *Table) GetBorderConfig() TableBorderConfig {
2828 return t .borderConfig
2929}
3030
31- // SetAlign sets whether to skip alignment for all columns.
32- func (t * Table ) SetAlign ( align bool ) {
33- t .align = align
31+ // SetAutoAlign sets whether to skip alignment for all columns.
32+ func (t * Table ) SetAutoAlign ( autoAlign bool ) {
33+ t .autoAlign = autoAlign
3434 // Recalculate render mode when alignment setting changes
3535 t .mode = t .determineRenderMode ()
3636
@@ -46,7 +46,7 @@ func (t *Table) SetAlign(align bool) {
4646
4747// GetAlign returns the current align setting.
4848func (t * Table ) GetAlign () bool {
49- return t .align
49+ return t .autoAlign
5050}
5151
5252// NewTable creates a new table with the given columns and optional configuration.
@@ -70,7 +70,7 @@ func NewTable(writer io.Writer, columns []Column, opts ...TableOption) *Table {
7070 writer : writer ,
7171 rows : make ([]Row , 0 ),
7272 padding : 1 ,
73- align : true , // Default to aligned columns
73+ autoAlign : true , // Default to auto-aligning columns
7474 borderStyle : BoxDrawingStyle ,
7575 borderConfig : borderConfig ,
7676 borders : borderConfig .Chars ,
@@ -113,10 +113,10 @@ func Header(style HeaderStyle) TableOption {
113113 }
114114}
115115
116- // Align sets the align flag (option).
117- func Align ( align bool ) TableOption {
116+ // AutoAlign sets the align flag (option).
117+ func AutoAlign ( autoAlign bool ) TableOption {
118118 return func (t * Table ) {
119- t .align = align
119+ t .autoAlign = autoAlign
120120 }
121121}
122122
@@ -146,7 +146,7 @@ func (t *Table) determineRenderMode() RenderMode {
146146 }
147147
148148 // Use streaming mode if no auto-width calculation needed OR no alignment needed
149- if ! hasAutoWidth || ! t .align {
149+ if ! hasAutoWidth || ! t .autoAlign {
150150 return StreamingMode
151151 }
152152
@@ -280,15 +280,15 @@ func (t *Table) RenderHeaderRow(row Row) error {
280280 content = cell .Content
281281
282282 // Apply alignment if not disabled
283- if t .align {
283+ if t .autoAlign {
284284 align := col .Align
285285 if cell .Align != Default {
286286 align = cell .Align
287287 }
288288 content = t .formatCell (content , col .Width , align )
289289 }
290290 } else {
291- if t .align {
291+ if t .autoAlign {
292292 if ! t .borderConfig .Padding {
293293 // No padding for empty cells
294294 content = strings .Repeat (" " , col .Width )
@@ -341,15 +341,15 @@ func (t *Table) RenderRow(row Row) error {
341341 content = cell .Content
342342
343343 // Apply alignment if not disabled
344- if t .align {
344+ if t .autoAlign {
345345 align := col .Align
346346 if cell .Align != Default {
347347 align = cell .Align
348348 }
349349 content = t .formatCell (content , col .Width , align )
350350 }
351351 } else {
352- if t .align {
352+ if t .autoAlign {
353353 if ! t .borderConfig .Padding {
354354 // No padding for empty cells
355355 content = strings .Repeat (" " , col .Width )
0 commit comments