How to enter data into the table with sorting?
Good day!
Would like to know how to implement the following functionality.
There is a calculator that after clicking the button is formed, the number is displayed in the table.
Roughly speaking there is a table in which there are numbers from 1 to 20 and creates a new number, say 12, and it should appear in the table on 12th place and the points should line up from 1 to 21.
I don't know how it's easier to do. Can show the Word or Excel file or simply laid out to the table once to remove them.
Files do not need to save, that is, after the display of the file it is not saved, just displayed in order.
Roughly speaking. How to sort the table
If anyone can help I would be very grateful!
1 answer
- Go through the table rows and save them in an array of objects. Each object two fields: the string table and the value of the number in that row.
- Sort this array by field number.
- Delete all rows from the table.
- Fill in the table rows from the sorted array of objects.
Find more questions by tags ExcelJavaScriptjQuery