Alexander Nikolov
Alexander Nikolov

Reputation: 1979

Right align text in text field - vaadin

What are my options if i want to right-align the text in vaadin text field ? is there any way to do this without using css ?

Css options will also be usefull.

Upvotes: 1

Views: 6878

Answers (2)

luis_t
luis_t

Reputation: 81

Since Vaadin 7.5:

TextField text = new TextField();
text.addStyleName(ValoTheme.TEXTFIELD_ALIGN_RIGHT);

Upvotes: 8

deltascience
deltascience

Reputation: 3390

As far as I know you can't align text to right in a TextField with vaadin. But you can do it with the CSS like this:

  • first set the style name:

    TextField text = new TextField(); text.setStyleName("my-text");

  • add CSS :

    .v-textfield-my-text{ text-align:right !important; }

Upvotes: 2

Related Questions