appreciated / card

A component similar webcomponent to <paper-card> for Vaadin 10
Apache License 2.0
6 stars 3 forks source link

Centering a component #7

Open allenvpn312 opened 4 years ago

allenvpn312 commented 4 years ago

Is there a way to center a component?

I tried using setJustifyContent(JusttifyContentMode.CENTER) and setAlignItems(Alignment.CENTER) and it doesn't do anything.

For example: Card card = new Card(new TitleLabel("Title"), new H1("Centered Text"));

Thanks

mrgreywater commented 3 years ago

try

card.getContent().setAlignItems(Alignment.CENTER);
card.getContent().setJustifyContentMode(JustifyContentMode.CENTER);