aptinio / text-table

A feature-rich, easy-to-use plain text table formatter.
MIT License
96 stars 14 forks source link

Align to :right by default? #2

Open klepsydra opened 12 years ago

klepsydra commented 12 years ago

Great gem! Thank you! Question, since my tables are mainly numeric, visually it is much better to have them aligned :right not :left by default.

I looked at the code, but am unsure how to add support for the Text::Table style to have newly created tables have :alignment => :right by default before they get initialized.

No quick global switch like datalist.to_table.alignment=:right seems to work either.

As it is now, I have to first create a table, keep it into a variable (not just puts someCSVdata.to_table), iterate through each column or cell to align right, then print the text table.