So i have table being echoed using php. i take data from the database and i populate the table. now i have data coming not in order. so my table is not in order. here is the table like
product | quantity | amount
===========================
Samosa | 2 | 20
Shwarma | 1 | 50
Fries | 1 | 30
i want to reorder the table using any method javascript,jquery,php. i want the amount to be in descending order like this
product | quantity | amount
===========================
Shwarma | 1 | 50
Fries | 1 | 30
Samosa | 2 | 20
things to note that 1) i calculate the amount after i fetch the data so i can't order it using mysql ORDER BY
2) i fetch and populate the data using an ajax request.
how do i do that?