To center table header inside vaadin grid.

I want to center both table header and its column row inside Vaadin Grid…

I run this HashMapWithGridAndBinder example (https://cookbook.vaadin.com/grid-with-map).

And it is how it looks now, not centered compared to it column row.

any thought welcomed.

many thanks.

I’m not sure what you mean by “centering” and “column row”.

If you want to center-align the text inside header and body cells in a particular column, there is a setTextAlign method on the Column class: https://vaadin.com/docs/latest/components/grid#column-alignment

image.png

you are right, thanks man…