JarekToro / responsive-layout

The layout to beat them all!
https://vaadin.com/directory#!addon/responsive-layout
57 stars 24 forks source link

Alignment Responsive Column #31

Closed fattanasio closed 7 years ago

fattanasio commented 7 years ago

Hi, how set aligment of ResponsiveColumn? I used col2.setAlignment(ColumnComponentAlignment.RIGHT); but doesn't work. I would a row with 3 columns. The first should be aligned to left, the 2nd e 3nd aligned to right. I use the last version of vaadin responsive-layout addon and Vaadin 7.6.2 Thank you !

JarekToro commented 7 years ago

Hello this is a grammatically misunderstanding. the col2.setAlignment(ColumnComponentAlignment.RIGHT) sets the alignment of the Columns Child. Not the columns alignment within its parent. The ResponsiveRow has a setAlignment to align its Child Columns but only as a group not able to give different alignments to columns.

You can possible achieve what you want if you get crafty with setOffset for example in your case,

you can add one column with a size of 3(for example) the add another column with a size of 3 and an offset of 3, then finally add the third column with a size of 3.

The offset will put a space of 3 in between the columns providing the layout you mentioned.

JarekToro commented 7 years ago

number of Xs being the col size you have. [Columns] {Offsets} col 1. offset col 2. col 3. [XXX]{XXX}[XXX][XXX]