I don't actually know html very well, this is my first experience, so there might be a better way, but in my case, among other things, I'm trying to print python code, and div margin-left doesn't seem to be quite what I'm looking for. This is the code that translates strings into my text field.
Code:
input = input.replace("<", "<").replace(">", ">").replace("\n", "<br/>").replace("\t", " ").replace(" ", " ");
String colorString = "";
colorString += String.format("%02x", getColor().getRed());
colorString += String.format("%02x", getColor().getGreen());
colorString += String.format("%02x", getColor().getBlue());
String finalString = "<div style=\"font:" + colorString + "\">" + input + "</div><br/>";