In the official documentation (https://vaadin.com/docs/v12/flow/components/tutorial-flow-grid.html) is stated:
In addition to plain text, the header and footer can contain HTML and components.
The following example is given:
// Sets a header containing a custom template,
// in this case simply bolding the caption "Name"
nameColumn.setHeader("<b>Name</b>"); // WRONG?!
However, the HTML codes are escaped. Diving deeper into the vaadin flow code, we eventual see this:
// AbstractColumn
protected void setHeaderText(String text) {
setHeaderRenderer(TemplateRenderer.of(HtmlUtils.escape(text)));
}
It seems that the header cannot be set as HTML. Is the documentation wrong? If not, how to set the text as HTML?
What works:
nameColumn.setHeader(new Html("<b>Name</b>")); // Only one root element!