I need to change the order of columns in a table in html / js dynamically, you can tell me how to do it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you only require to simply move a column without any fancy drag-drop animation, the following JS should do the trick:
Replacing the numbers as necessary. The concept works
It seems that writing this as a one liner isn’t really possible. including td in the selector, even with the row selector seems to hold each td on a separate index, ignoring rows.
A jQuery grid plugin should do the trick otherwise. Although I have no experience with such plugins.