I have succeeded in collecting a Google docs thumbnail image and converting it from byte[]
to base64
and then appending it to a pre-existing object in the DOM on its own using the below snippet from this answer.
var image = $("<img>", {
"src": "data:image/png;base64," + base64_string,
"width": "250px", "height": "250px"})
.appendTo("#img_preview");
However, what I really want to do is convert the base64 object into an HTML string and then add it into a table each time a new row is generated.
$("#output").append("<tr><td>"+ image +"</td></tr>" );
One solution I have thought of is to programmatically add ids to the td elements and then use the first snippet but that doesn't seem efficient.
Can anyone help?