Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Display red star sign in a column

Vince Chen
9 years ago Apr 25, 2012 8:49am
Jouni Koivuviita
9 years ago Apr 25, 2012 9:16am

You need to use a column whose type is a Label instead of plain String. Then you can add a Label component in XHTML mode to the column and style the red asterisk using CSS.

Instead of

table.addContainerProperty("column name", String.class, null);

use

table.addContainerProperty("column name", Label.class, null);

And for the Label:

new Label("<span class=\"red\">*</span>Project No", Label.CONTENT_XHTML);
.red {
  color: red;
}