user5236938
user5236938

Reputation:

Javascript auto refresh div in table

I have a table with a div inside of it that auto loads every 10 seconds to add or remove rows. The issue I'm having is that it's not putting it in the table. It's putting the rows above the entire table.

<script>
var auto_refresh = setInterval(
function ()
{
$('#load_pilots').load('pilots.html').fadeIn("slow");
}, 10000);
</script>

The HTML

<div id="load_pilots">
      <?php $mining->activePilots(); ?>
</div>

the outcome of activePilots() is

<tr><td>Text</td><td>Text</td><td>Text</td><td>Text</td></tr> 

What I want to happen is the table rows go into the table, but instead they are going above the table and my browser has them as "stray tags."

EDIT: Some rows are static in the table, not adding the id to the table would not work because some rows stay there.

Upvotes: 1

Views: 357

Answers (1)

misss-popcorn
misss-popcorn

Reputation: 600

You have to give id to your table and not div for that .

Upvotes: 1

Related Questions