We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee80186 commit f14aba1Copy full SHA for f14aba1
1 file changed
lib/table_formatter.rb
@@ -70,8 +70,9 @@ def build_separator(col_widths)
70
end
71
72
def format_row(row, col_widths)
73
- row.map.with_index { |cell, i| cell.ljust(col_widths[i]) }
74
- .join(COLUMN_SEPARATOR)
75
- .rstrip
+ row.map.with_index { |cell, i|
+ i == 0 ? cell.ljust(col_widths[i]) : cell.rjust(col_widths[i])
+ }.join(COLUMN_SEPARATOR)
76
+ .rstrip
77
78
0 commit comments