Edge Compk
Edge Compk

Reputation: 37

appending to table ajax

I am having difficulties appending to my table. I keep on appending above the names. Here is the code:

  Name  id
  Javi  1
  Tomi  2

Well the data keeps on appending at the top. Here is the code:

  Lulu  3
  Name  id
  Javi  1
  Tomi  2 

The code that I am using to append the data is the following. Here is the code:

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

How can I append my data correctly?

Upvotes: 0

Views: 34

Answers (2)

Kyle Needham
Kyle Needham

Reputation: 3389

You need to use .appendTo(), prependTo() adds data to the beginning. Demo

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

See .appendTo() documentation.

Upvotes: 1

jgillich
jgillich

Reputation: 76219

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

Upvotes: 1

Related Questions