jQuery Controls
jQuery Controls allow developers to write HTML code (XML compliant) that can be invoked from JavaScript using jQuery:
testControl.jc
<div>
    <table>
        <tr>
            <td>First Name:</td>
            <td><span id="firstName" /></td>
        </tr>
        <tr>
            <td>Last Name:</td>
            <td><span id="lastName" /></td>
        </tr>
        <tr>
            <td>Photo:</td>
            <td><img id="photo" /></td>
        </tr>
    </table>
</div>
JavaScript code
var test = new testControl ();
test.firstName.text ("John");
test.lastName.text ("Doe");
test.photo.attr ("src", "/photo.jpg");
$('#someDiv').append (test.root);
Result