Evertras / bubble-table

A customizable, interactive table component for the Bubble Tea framework
MIT License
439 stars 25 forks source link

Make table columns on the right side #26

Closed abdfnx closed 2 years ago

abdfnx commented 2 years ago

Hi @Evertras, first thanks for this great library

Can you make an option to have the table column on the right side?

Evertras commented 2 years ago

Hey there, glad you like it!

Could you elaborate what you mean? As in, have the text aligned to the right? Or do you mean the selectable column that's added?

abdfnx commented 2 years ago

Hey there, glad you like it!

Could you elaborate what you mean? As in, have the text aligned to the right? Or do you mean the selectable column that's added?

Hi, thanks for reply

Yes I mean right align text

Evertras commented 2 years ago

If you want to style an individual column, you can do this by applying myCol.WithStyle(lipgloss.NewStyle().Align(lipgloss.Right)). Example here, just use .Align to change the alignment. You can also do this on a per-row or per-cell basis. There is not a way to apply a single global base style, which is something I'm happy to add to help this issue as that seems useful for various reasons anyway.

I'm a little confused though, as the default is to align things to the right. Could you show me a screenshot or a paste of the alignment you're seeing?

abdfnx commented 2 years ago

If you want to style an individual column, you can do this by applying myCol.WithStyle(lipgloss.NewStyle().Align(lipgloss.Right)). Example here, just use .Align to change the alignment. You can also do this on a per-row or per-cell basis. There is not a way to apply a single global base style, which is something I'm happy to add to help this issue as that seems useful for various reasons anyway.

I'm a little confused though, as the default is to align things to the right. Could you show me a screenshot or a paste of the alignment you're seeing?

Ok, thanks for your help, keep your awesome work