@@ -991,7 +991,7 @@ func (t *Table) calculateContentMaxWidth(colIdx int, config tw.CellConfig, padLe
991991 constraintTotalCellWidth := 0
992992 hasConstraint := false
993993
994- // 1. Check new Widths.PerColumn (highest priority)
994+ // Check new Widths.PerColumn (highest priority)
995995 if t .config .Widths .Constrained () {
996996
997997 if colWidth , ok := t .config .Widths .PerColumn .OK (colIdx ); ok && colWidth > 0 {
@@ -1001,15 +1001,15 @@ func (t *Table) calculateContentMaxWidth(colIdx int, config tw.CellConfig, padLe
10011001 colIdx , constraintTotalCellWidth )
10021002 }
10031003
1004- // 2. Check new Widths.Global
1004+ // Check new Widths.Global
10051005 if ! hasConstraint && t .config .Widths .Global > 0 {
10061006 constraintTotalCellWidth = t .config .Widths .Global
10071007 hasConstraint = true
10081008 t .logger .Debugf ("calculateContentMaxWidth: Using Widths.Global = %d" , constraintTotalCellWidth )
10091009 }
10101010 }
10111011
1012- // 3. Fall back to legacy ColMaxWidths.PerColumn (backward compatibility)
1012+ // Fall back to legacy ColMaxWidths.PerColumn (backward compatibility)
10131013 if ! hasConstraint && config .ColMaxWidths .PerColumn != nil {
10141014 if colMax , ok := config .ColMaxWidths .PerColumn .OK (colIdx ); ok && colMax > 0 {
10151015 constraintTotalCellWidth = colMax
@@ -1019,15 +1019,15 @@ func (t *Table) calculateContentMaxWidth(colIdx int, config tw.CellConfig, padLe
10191019 }
10201020 }
10211021
1022- // 4. Fall back to legacy ColMaxWidths.Global
1022+ // Fall back to legacy ColMaxWidths.Global
10231023 if ! hasConstraint && config .ColMaxWidths .Global > 0 {
10241024 constraintTotalCellWidth = config .ColMaxWidths .Global
10251025 hasConstraint = true
10261026 t .logger .Debugf ("calculateContentMaxWidth: Using legacy ColMaxWidths.Global = %d" ,
10271027 constraintTotalCellWidth )
10281028 }
10291029
1030- // 5. Fall back to table MaxWidth if auto-wrapping
1030+ // Fall back to table MaxWidth if auto-wrapping
10311031 if ! hasConstraint && t .config .MaxWidth > 0 && config .Formatting .AutoWrap != tw .WrapNone {
10321032 constraintTotalCellWidth = t .config .MaxWidth
10331033 hasConstraint = true
@@ -1224,7 +1224,7 @@ func (t *Table) convertToString(value interface{}) string {
12241224func (t * Table ) convertItemToCells (item interface {}) ([]string , error ) {
12251225 t .logger .Debugf ("convertItemToCells: Converting item of type %T" , item )
12261226
1227- // 1. User-defined table-wide stringer (t.stringer) takes highest precedence.
1227+ // User-defined table-wide stringer (t.stringer) takes highest precedence.
12281228 if t .stringer != nil {
12291229 res , err := t .convertToStringer (item )
12301230 if err == nil {
@@ -1234,21 +1234,21 @@ func (t *Table) convertItemToCells(item interface{}) ([]string, error) {
12341234 t .logger .Warnf ("convertItemToCells: Custom table stringer was set but incompatible for type %T: %v. Will attempt other methods." , item , err )
12351235 }
12361236
1237- // 2. Handle untyped nil directly.
1237+ // Handle untyped nil directly.
12381238 if item == nil {
12391239 t .logger .Debugf ("convertItemToCells: Item is untyped nil. Returning single empty cell." )
12401240 return []string {"" }, nil
12411241 }
12421242
1243- // 3. Use the new unified struct parser. It handles pointers and embedding.
1243+ // Use the new unified struct parser. It handles pointers and embedding.
12441244 // We only care about the values it returns.
12451245 _ , values := t .extractFieldsAndValuesFromStruct (item )
12461246 if values != nil {
12471247 t .logger .Debugf ("convertItemToCells: Structs %T reflected into %d cells: %v" , item , len (values ), values )
12481248 return values , nil
12491249 }
12501250
1251- // 4. Fallback for any other single item (e.g., basic types, or types that implement Stringer/Formatter).
1251+ // Fallback for any other single item (e.g., basic types, or types that implement Stringer/Formatter).
12521252 // This code path is now for non-struct types.
12531253 if formatter , ok := item .(tw.Formatter ); ok {
12541254 t .logger .Debugf ("convertItemToCells: Item (non-struct, type %T) is tw.Formatter. Using Format()." , item )
0 commit comments