It depends what you mean by ORDER, do you mean order or RE-ORDER
If you just want to display the rows in a particular order, by orderid, by name or by date, then this is easily done by adding the ORDER BY clause into the SQL.
Once the page has been created and sent to the browser, the order is fixed, unless you use ajax.
Another approach is to use a spry dataset, (also uses ajax), which is well documented.
A further approach, (but it means refreshing the page), is to have the 'order by' determined by a form variable, and when the form is posted, use this variable in the SQL