Edge Compk
Edge Compk

Reputation: 37

Data append to the top row of the table

how can I append the data to the top row of my table. Here is my code:

   $(data).appendTo('#feeds:last');

How can I append data to the top row of my table?

Upvotes: 1

Views: 78

Answers (1)

adaam
adaam

Reputation: 3706

If you want to add an element to the top of a table you can use prepend():

$('#feeds').prepend(data);

Example here: http://jsfiddle.net/KZ7qc/

jQuery docs: http://api.jquery.com/prepend/

If I have misunderstood your question and you really want it to be the last row, then you can just change the above code to append()

Upvotes: 1

Related Questions