I seem to have problem with my jQuery script.

$("top").append("<tr><td align='right' class='whtxt'><strong>"+this['date']+"</strong></td><td align='right' class='whtxt'><strong>"+this['name']+"</strong></td></tr>");

jumps top of the <th> tag, it should stay under there as table.

<div style="width: 100%;">
    <table width="100%" align="right">
        <tr>
            <th align="right"><h5 style="padding:0;margin:0;">One</h5></th>
            <th align="right"><h5 style="padding:0;margin:0;">Two</h5></th>
        </tr>
        <top></top>
    </table>
    </div>

---

$(document).ready(function() {
    done();
});

function done() {
    setTimeout(function() {
    updates();
    done();
    }, 200);    
}

function updates() {
    $.getJSON("include/index.php", function(data) {
        $("top").empty();

        $.each(data.result, function() {

            $("top").append("<tr><td align='right' class='whtxt'><strong>"+this['date']+"</strong></td><td align='right' class='whtxt'><strong>"+this['name']+"</strong></td></tr>");
        });
    });
}

I'd suggest you add an ID to your table and use:

$("#myTable tr:last").after("<your html>");

This will add the new row at the end of the table.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.