Align content to the right in Grid column

How does one right-align the content of a column in the new Grid widget? All content is left-aligned by default, including Integer values.

Use a CellStyleGenerator. Let’s say that the property you want to right align is called “amount”. Apply the CellStyleGenerator for Grid and add appropriate CSS that aligns the content.

grid.setCellStyleGenerator(new CellStyleGenerator() { @Override public String getStyle(CellReference cellReference) { if("amount".equals(cellReference.getPropertyId())) { return "right-align"; } return null; } }); …and the CSS:

.right-align {
    text-align: right;

That works.

How about aligning the
column header
to match?