Vaadin 7 - Table, how to set right aligment in rows

Viewed 16

i have problem to set aligment right in rows in table.

I need to keep aligment left in all headers. But i want aligment right only in specific columns. In rows not in headers.

All elements in table are String.

I know there is method:

table.setColumnAlignment("Address", Table.Align.RIGHT);

But it makes headers and rows aligment right. I need to keep headers aligment left.

table.addContainerProperty("Name", String.class, null);

table.addContainerProperty("Age", String.class, null);

table.addContainerProperty("Address", String.class, null);

I try resolve my problem by css.

table.setCellStyleGenerator(new Table.CellStyleGenerator() {
    @Override
    public String getStyle(Table source, Object itemId, Object propertyId) {
           return "numeric";
    }
});

And my style in CSS is:

 .v-table-cell-content-numeric {
        text-align: right;
   }

But it dont work.

Any advice?

Regards

0 Answers
Related