HMTL text formatting doesn't work if power table cell is word wrapped

Background : previous forum post

I've got a table that shows user-entered and system-generated notes associated with a downtime event. Client's requested to make system-generated text bold and leave user-entered text non-formatted for easy distinction. Using html tags show up in plain text due to word wrap being enabled on the cell.

Is this a "one or the other" type scenario or is there something I can do to have the best of both worlds.
Thanks

Screenshot:
image

Ignition 8.1.24, Vision

This is not the most efficient implementation (the renderer should be created and cached in initialize), but it proves the concept:

def configureCell(self, value, textValue, selected, rowIndex, colIndex, colName, rowView, colView):
	if colName == "String Column":
		from com.jidesoft.grid import StyledTableCellRenderer
		from com.jidesoft.swing import StyledLabelBuilder
		
		renderer = StyledTableCellRenderer()
		StyledLabelBuilder.setStyledText(renderer, textValue)
		renderer.lineWrap = True
		return {'renderer': renderer}

StyledLabel/StyledTableCellRenderer support their own special markup format:

3 Likes

Thanks, I'll mess around with this