How to center label in DataGrid

Hi everyone,

How do I center a label in DataGrid. I am using column generator in DataGrid and return label as component using
@Inject
private UiComponents uiComponents

Label label = uiComponents.create(Label.TYPE_STRING);

and my output is like this:
datagrid

how do I make the label 25.50 to be center. Please help me & thanks in advanced.
Regards,
Syamil

Hi,

It’s hard to make any suggestions without reviewing your code. Considering a big gap between two cells, it seems that you’ve changed rows height. The demo project that demonstrates the issue is highly appreciated.

Regards,
Gleb