I am able to incorporate CSS into the HTML, like this:
document.writeln("<tr><td [B]style="background-color:#FFFF00;"[/B]>" + "test" + "</td></tr>");
document.write("<tr><td style='background-color:#FFFF00;'>" + "test" + "</td></tr>")
You shouldn’t really be using document.write since it is far less flexible than any of the alternatives (such as using innerHTML or DOM calls).
Also it would probably be better if you had that CSS in a separate file allocated to a class and then just added the class to the <td>
you can add a class via the DOM.
document.getElementById("blah").className = "cssclass";
So if you had your style created in your css stylesheet and wanted to apply a style to that table cell, add a class to the td using the corresponding ID.